/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.audit.Audit
 *  com.l7tech.gateway.common.security.password.SecurePasswordReferenceExpander
 *  com.l7tech.objectmodel.FindException
 */
package com.l7tech.server.policy.variable;

import com.l7tech.gateway.common.audit.Audit;
import com.l7tech.gateway.common.security.password.SecurePasswordReferenceExpander;
import com.l7tech.objectmodel.FindException;
import com.l7tech.server.policy.variable.ServerVariables;

public class GatewaySecurePasswordReferenceExpander
implements SecurePasswordReferenceExpander {
    private final Audit a;
    private final boolean b;

    public GatewaySecurePasswordReferenceExpander(Audit audit) {
        this.a = audit;
        this.b = false;
    }

    public GatewaySecurePasswordReferenceExpander(Audit audit, boolean bl2) {
        this.a = audit;
        this.b = bl2;
    }

    public char[] expandPasswordReference(String string) throws FindException {
        try {
            if (this.b) {
                return ServerVariables.expandPasswordOnlyVariable(this.a, string).toCharArray();
            }
        }
        catch (FindException findException) {
            throw GatewaySecurePasswordReferenceExpander.a(findException);
        }
        return ServerVariables.expandSinglePasswordOnlyVariable(this.a, string).toCharArray();
    }

    private static FindException a(FindException findException) {
        return findException;
    }
}

