/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.common.io.XmlUtil
 *  com.l7tech.gateway.common.LicenseException
 *  com.l7tech.gateway.common.security.keystore.SsgKeyEntry
 *  com.l7tech.identity.User
 *  com.l7tech.message.Message
 *  com.l7tech.message.SecurityKnob
 *  com.l7tech.message.XmlKnob
 *  com.l7tech.policy.AssertionPath
 *  com.l7tech.policy.PolicyPathBuilderFactory
 *  com.l7tech.policy.PolicyPathResult
 *  com.l7tech.policy.PolicyTooComplexException
 *  com.l7tech.policy.assertion.Assertion
 *  com.l7tech.policy.assertion.AssertionStatus
 *  com.l7tech.policy.assertion.PolicyAssertionException
 *  com.l7tech.policy.assertion.SslAssertion
 *  com.l7tech.policy.assertion.composite.AllAssertion
 *  com.l7tech.policy.assertion.composite.CompositeAssertion
 *  com.l7tech.policy.assertion.composite.OneOrMoreAssertion
 *  com.l7tech.policy.assertion.credential.http.HttpBasic
 *  com.l7tech.policy.assertion.credential.http.HttpDigest
 *  com.l7tech.policy.assertion.credential.wss.WssBasic
 *  com.l7tech.policy.assertion.identity.IdentityAssertion
 *  com.l7tech.policy.assertion.xmlsec.RequestWssKerberos
 *  com.l7tech.policy.assertion.xmlsec.RequireWssSaml
 *  com.l7tech.policy.assertion.xmlsec.RequireWssSignedElement
 *  com.l7tech.policy.assertion.xmlsec.RequireWssTimestamp
 *  com.l7tech.policy.assertion.xmlsec.RequireWssX509Cert
 *  com.l7tech.policy.assertion.xmlsec.SamlAuthenticationStatement
 *  com.l7tech.policy.assertion.xmlsec.SecureConversation
 *  com.l7tech.policy.wsp.WspWriter
 *  com.l7tech.security.saml.SamlConstants
 *  com.l7tech.security.xml.SecurityTokenResolver
 *  com.l7tech.security.xml.decorator.DecorationRequirements
 *  com.l7tech.security.xml.decorator.DecoratorException
 *  com.l7tech.security.xml.decorator.WssDecoratorImpl
 *  com.l7tech.security.xml.processor.ProcessorResult
 *  com.l7tech.security.xml.processor.SecurityContextFinder
 *  com.l7tech.security.xml.processor.WssProcessorImpl
 *  com.l7tech.util.Config
 *  com.l7tech.util.ConfigFactory
 *  com.l7tech.util.DomUtils
 *  com.l7tech.util.ExceptionUtils
 *  com.l7tech.util.InvalidDocumentFormatException
 *  com.l7tech.util.MissingRequiredElementException
 *  com.l7tech.util.ResourceUtils
 *  com.l7tech.util.SoapConstants
 *  com.l7tech.xml.SoapFaultDetail
 *  com.l7tech.xml.SoapFaultLevel
 *  com.l7tech.xml.soap.SoapFaultUtils
 *  com.l7tech.xml.soap.SoapUtil
 *  com.l7tech.xml.soap.SoapVersion
 *  com.l7tech.xml.xpath.XpathExpression
 *  org.springframework.context.support.ApplicationObjectSupport
 */
package com.l7tech.server.policy;

import com.l7tech.common.io.XmlUtil;
import com.l7tech.gateway.common.LicenseException;
import com.l7tech.gateway.common.security.keystore.SsgKeyEntry;
import com.l7tech.identity.User;
import com.l7tech.message.Message;
import com.l7tech.message.SecurityKnob;
import com.l7tech.message.XmlKnob;
import com.l7tech.policy.AssertionPath;
import com.l7tech.policy.PolicyPathBuilderFactory;
import com.l7tech.policy.PolicyPathResult;
import com.l7tech.policy.PolicyTooComplexException;
import com.l7tech.policy.assertion.Assertion;
import com.l7tech.policy.assertion.AssertionStatus;
import com.l7tech.policy.assertion.PolicyAssertionException;
import com.l7tech.policy.assertion.SslAssertion;
import com.l7tech.policy.assertion.composite.AllAssertion;
import com.l7tech.policy.assertion.composite.CompositeAssertion;
import com.l7tech.policy.assertion.composite.OneOrMoreAssertion;
import com.l7tech.policy.assertion.credential.http.HttpBasic;
import com.l7tech.policy.assertion.credential.http.HttpDigest;
import com.l7tech.policy.assertion.credential.wss.WssBasic;
import com.l7tech.policy.assertion.identity.IdentityAssertion;
import com.l7tech.policy.assertion.xmlsec.RequestWssKerberos;
import com.l7tech.policy.assertion.xmlsec.RequireWssSaml;
import com.l7tech.policy.assertion.xmlsec.RequireWssSignedElement;
import com.l7tech.policy.assertion.xmlsec.RequireWssTimestamp;
import com.l7tech.policy.assertion.xmlsec.RequireWssX509Cert;
import com.l7tech.policy.assertion.xmlsec.SamlAuthenticationStatement;
import com.l7tech.policy.assertion.xmlsec.SecureConversation;
import com.l7tech.policy.wsp.WspWriter;
import com.l7tech.security.saml.SamlConstants;
import com.l7tech.security.xml.SecurityTokenResolver;
import com.l7tech.security.xml.decorator.DecorationRequirements;
import com.l7tech.security.xml.decorator.DecoratorException;
import com.l7tech.security.xml.decorator.WssDecoratorImpl;
import com.l7tech.security.xml.processor.ProcessorResult;
import com.l7tech.security.xml.processor.SecurityContextFinder;
import com.l7tech.security.xml.processor.WssProcessorImpl;
import com.l7tech.server.DefaultKey;
import com.l7tech.server.message.PolicyEnforcementContext;
import com.l7tech.server.policy.ServerPolicyException;
import com.l7tech.server.policy.ServerPolicyFactory;
import com.l7tech.server.policy.assertion.ServerAssertion;
import com.l7tech.server.policy.filter.FilterManager;
import com.l7tech.server.policy.filter.FilteringException;
import com.l7tech.server.policy.filter.HideDisabledAssertions;
import com.l7tech.util.Config;
import com.l7tech.util.ConfigFactory;
import com.l7tech.util.DomUtils;
import com.l7tech.util.ExceptionUtils;
import com.l7tech.util.InvalidDocumentFormatException;
import com.l7tech.util.MissingRequiredElementException;
import com.l7tech.util.ResourceUtils;
import com.l7tech.util.SoapConstants;
import com.l7tech.xml.SoapFaultDetail;
import com.l7tech.xml.SoapFaultLevel;
import com.l7tech.xml.soap.SoapFaultUtils;
import com.l7tech.xml.soap.SoapUtil;
import com.l7tech.xml.soap.SoapVersion;
import com.l7tech.xml.xpath.XpathExpression;
import java.io.Closeable;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.SignatureException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.springframework.context.support.ApplicationObjectSupport;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.xml.sax.SAXException;

public class PolicyService
extends ApplicationObjectSupport {
    private static final Logger a;
    private static final boolean b;
    private static final boolean c;
    private static final boolean d;
    private static final String e;
    private final List<Assertion> f;
    private final List<Assertion> g;
    private final Config h;
    private final DefaultKey i;
    private final ServerPolicyFactory j;
    private final FilterManager k;
    private final SecurityTokenResolver l;
    private final PolicyPathBuilderFactory m;
    private final SecurityContextFinder n;
    private static final Assertion[] o;
    private static final Assertion[] p;
    private static final String[] q;

    public PolicyService(Config config, DefaultKey defaultKey, ServerPolicyFactory serverPolicyFactory, FilterManager filterManager, SecurityTokenResolver securityTokenResolver, PolicyPathBuilderFactory policyPathBuilderFactory, SecurityContextFinder securityContextFinder) {
        if (config == null) {
            String[] stringArray = q;
            throw new IllegalArgumentException(stringArray[30]);
        }
        try {
            if (defaultKey == null) {
                throw new IllegalArgumentException(q[15]);
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw PolicyService.a(illegalArgumentException);
        }
        try {
            if (serverPolicyFactory == null) {
                throw new IllegalArgumentException(q[4]);
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw PolicyService.a(illegalArgumentException);
        }
        try {
            if (filterManager == null) {
                throw new IllegalArgumentException(q[42]);
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw PolicyService.a(illegalArgumentException);
        }
        try {
            if (policyPathBuilderFactory == null) {
                throw new IllegalArgumentException(q[48]);
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw PolicyService.a(illegalArgumentException);
        }
        this.h = config;
        this.i = defaultKey;
        this.j = serverPolicyFactory;
        this.k = filterManager;
        this.l = securityTokenResolver;
        this.m = policyPathBuilderFactory;
        this.n = securityContextFinder;
        this.f = this.a(o);
        boolean bl2 = config.getBooleanProperty(q[18], false);
        ArrayList<Assertion> arrayList = new ArrayList<Assertion>(Arrays.asList(p));
        try {
            if (bl2) {
                arrayList.add(0, (Assertion)new HttpDigest());
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw PolicyService.a(illegalArgumentException);
        }
        this.g = this.a(arrayList.toArray(new Assertion[arrayList.size()]));
    }

    private List<Assertion> a(Assertion[] assertionArray) {
        ArrayList<Assertion> arrayList = new ArrayList<Assertion>();
        for (Assertion assertion : assertionArray) {
            if (assertion instanceof RequireWssSaml) {
                RequireWssSaml requireWssSaml = (RequireWssSaml)assertion;
                requireWssSaml.setCheckAssertionValidity(false);
                requireWssSaml.setNameFormats(SamlConstants.ALL_NAMEIDENTIFIERS);
                SamlAuthenticationStatement samlAuthenticationStatement = new SamlAuthenticationStatement();
                samlAuthenticationStatement.setAuthenticationMethods(SamlConstants.ALL_AUTHENTICATIONS);
                requireWssSaml.setAuthenticationStatement(samlAuthenticationStatement);
                requireWssSaml.setNoSubjectConfirmation(true);
            }
            arrayList.add(assertion);
        }
        return Collections.unmodifiableList(arrayList);
    }

    public Document respondToPolicyDownloadRequest(String string, String string2, User user, PolicyGetter policyGetter, boolean bl2) throws FilteringException, IOException, SAXException, PolicyAssertionException {
        Assertion assertion;
        WspWriter wspWriter;
        block19: {
            block20: {
                boolean bl3;
                Assertion assertion2;
                block18: {
                    Assertion assertion3;
                    wspWriter = new WspWriter();
                    wspWriter.setTargetVersion(string2);
                    ServiceInfo serviceInfo = policyGetter.getPolicy(string);
                    try {
                        assertion3 = serviceInfo != null ? serviceInfo.getPolicy() : null;
                    }
                    catch (InterruptedException interruptedException) {
                        throw PolicyService.a(interruptedException);
                    }
                    assertion2 = assertion3;
                    try {
                        if (assertion2 == null) {
                            a.info(q[47] + string);
                            return null;
                        }
                    }
                    catch (InterruptedException interruptedException) {
                        throw PolicyService.a(interruptedException);
                    }
                    try {
                        if (bl2) {
                            wspWriter.setPolicy(assertion2);
                            return XmlUtil.stringToDocument((String)wspWriter.getPolicyXmlAsString());
                        }
                    }
                    catch (InterruptedException interruptedException) {
                        throw PolicyService.a(interruptedException);
                    }
                    try {
                        bl3 = this.a(assertion2);
                    }
                    catch (InterruptedException interruptedException) {
                        throw new RuntimeException(interruptedException);
                    }
                    try {
                        try {
                            if (user != null || bl3) break block18;
                        }
                        catch (InterruptedException interruptedException) {
                            throw PolicyService.a(interruptedException);
                        }
                        return null;
                    }
                    catch (InterruptedException interruptedException) {
                        throw PolicyService.a(interruptedException);
                    }
                }
                assertion = this.k.applyAllFilters(user, assertion2);
                try {
                    try {
                        if (assertion != null) break block19;
                        if (!bl3) break block20;
                    }
                    catch (InterruptedException interruptedException) {
                        throw PolicyService.a(interruptedException);
                    }
                    wspWriter.setPolicy(null);
                    return XmlUtil.stringToDocument((String)wspWriter.getPolicyXmlAsString());
                }
                catch (InterruptedException interruptedException) {
                    throw PolicyService.a(interruptedException);
                }
            }
            return null;
        }
        wspWriter.setPolicy(assertion);
        return XmlUtil.stringToDocument((String)wspWriter.getPolicyXmlAsString());
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     * Loose catch block
     */
    public void respondToPolicyDownloadRequest(PolicyEnforcementContext policyEnforcementContext, boolean bl2, PolicyGetter policyGetter) throws IOException, SAXException, PolicyAssertionException {
        Object object;
        ServiceInfo serviceInfo;
        String[] stringArray;
        String string;
        String string2;
        SoapVersion soapVersion;
        Message message;
        block38: {
            Object object2;
            SoapVersion soapVersion2;
            SecurityKnob securityKnob;
            XmlKnob xmlKnob;
            block36: {
                block35: {
                    xmlKnob = policyEnforcementContext.getRequest().getXmlKnob();
                    securityKnob = policyEnforcementContext.getRequest().getSecurityKnob();
                    message = policyEnforcementContext.getResponse();
                    if (policyEnforcementContext.getService() == null) break block35;
                    try {
                        block41: {
                            if (policyEnforcementContext.getService().getSoapVersion() != SoapVersion.SOAP_1_2) break block35;
                            break block41;
                            catch (Exception exception) {
                                throw PolicyService.a(exception);
                            }
                        }
                        soapVersion2 = SoapVersion.SOAP_1_2;
                        break block36;
                    }
                    catch (Exception exception) {
                        throw PolicyService.a(exception);
                    }
                }
                soapVersion2 = SoapVersion.SOAP_1_1;
            }
            soapVersion = soapVersion2;
            Document document = xmlKnob.getDocumentWritable();
            try {
                object2 = new WssProcessorImpl();
                ProcessorResult processorResult = object2.undecorateMessage(policyEnforcementContext.getRequest(), this.n, this.l);
                securityKnob.setProcessorResult(processorResult);
            }
            catch (Exception exception) {
                message.initialize(this.a(soapVersion, exception));
                policyEnforcementContext.setPolicyResult(AssertionStatus.BAD_REQUEST);
                return;
            }
            try {
                object2 = this.a(document);
                string2 = this.b(document);
                string = SoapUtil.getL7aMessageId((Document)document);
            }
            catch (InvalidDocumentFormatException invalidDocumentFormatException) {
                message.initialize(this.a(soapVersion, (Exception)((Object)invalidDocumentFormatException)));
                policyEnforcementContext.setPolicyResult(AssertionStatus.BAD_REQUEST);
                return;
            }
            stringArray = q;
            a.finest(stringArray[26] + string2 + stringArray[35] + (String)object2);
            serviceInfo = policyGetter.getPolicy(string2);
            Assertion assertion = serviceInfo.getPolicy();
            if (assertion == null) {
                Document document2;
                a.info(stringArray[9] + string2);
                try {
                    document2 = SoapFaultUtils.generateSoapFaultDocument((SoapVersion)soapVersion, (String)SoapUtil.FC_SERVER, (String)(stringArray[13] + string2 + stringArray[33]), null, (String)"");
                }
                catch (IOException iOException) {
                    document2 = this.a(soapVersion, iOException);
                }
                catch (SAXException sAXException) {
                    document2 = this.a(soapVersion, sAXException);
                }
                message.initialize(document2);
                policyEnforcementContext.setPolicyResult(AssertionStatus.BAD_REQUEST);
                return;
            }
            boolean bl3 = false;
            try {
                if (this.a(assertion)) {
                    bl3 = true;
                } else {
                    stringArray = q;
                    a.fine(stringArray[8]);
                }
            }
            catch (InterruptedException interruptedException) {
                throw new RuntimeException(interruptedException);
            }
            AssertionStatus assertionStatus = null;
            if (!bl3) {
                stringArray = q;
                a.fine(stringArray[34]);
                object = null;
                try {
                    boolean bl4 = this.h.getBooleanProperty(stringArray[6], true);
                    object = this.a(assertion, bl4);
                    assertionStatus = object.checkRequest(policyEnforcementContext);
                    policyEnforcementContext.setPolicyResult(assertionStatus);
                }
                catch (IOException iOException) {
                    message.initialize(this.a(soapVersion, iOException));
                    stringArray = q;
                    a.log(Level.WARNING, stringArray[38], ExceptionUtils.getDebugException((Throwable)iOException));
                    policyEnforcementContext.setPolicyResult(AssertionStatus.SERVER_ERROR);
                    ResourceUtils.closeQuietly((Closeable)object);
                    return;
                }
                catch (PolicyAssertionException policyAssertionException) {
                    message.initialize(this.a(soapVersion, (Exception)((Object)policyAssertionException)));
                    stringArray = q;
                    a.log(Level.WARNING, stringArray[29], ExceptionUtils.getDebugException((Throwable)policyAssertionException));
                    policyEnforcementContext.setPolicyResult(AssertionStatus.SERVER_ERROR);
                    {
                        catch (Throwable throwable) {
                            ResourceUtils.closeQuietly(object);
                            throw throwable;
                        }
                    }
                    ResourceUtils.closeQuietly((Closeable)object);
                    return;
                }
                ResourceUtils.closeQuietly((Closeable)object);
            }
            object = null;
            try {
                if (!bl3 && assertionStatus != AssertionStatus.NONE) break block38;
            }
            catch (Exception exception) {
                throw PolicyService.a(exception);
            }
            try {
                User user = policyEnforcementContext.getDefaultAuthenticationContext().getLastAuthenticatedUser();
                object = this.respondToPolicyDownloadRequest(string2, (String)object2, user, policyGetter, false);
            }
            catch (FilteringException filteringException) {
                message.initialize(this.a(soapVersion, filteringException));
                stringArray = q;
                a.log(Level.WARNING, stringArray[24] + ExceptionUtils.getMessage((Throwable)filteringException), ExceptionUtils.getDebugException((Throwable)filteringException));
                policyEnforcementContext.setPolicyResult(AssertionStatus.SERVER_ERROR);
                return;
            }
            catch (IOException iOException) {
                message.initialize(this.a(soapVersion, iOException));
                stringArray = q;
                a.log(Level.WARNING, stringArray[27] + ExceptionUtils.getMessage((Throwable)iOException), ExceptionUtils.getDebugException((Throwable)iOException));
                policyEnforcementContext.setPolicyResult(AssertionStatus.SERVER_ERROR);
                return;
            }
            catch (SAXException sAXException) {
                message.initialize(this.a(soapVersion, sAXException));
                stringArray = q;
                a.log(Level.WARNING, stringArray[27] + ExceptionUtils.getMessage((Throwable)sAXException), ExceptionUtils.getDebugException((Throwable)sAXException));
                policyEnforcementContext.setPolicyResult(AssertionStatus.SERVER_ERROR);
                return;
            }
        }
        if (object == null) {
            SoapFaultLevel soapFaultLevel;
            block40: {
                block39: {
                    soapFaultLevel = new SoapFaultLevel();
                    try {
                        soapFaultLevel.setLevel(1);
                        if (soapVersion != SoapVersion.SOAP_1_2) break block39;
                        soapFaultLevel.setFaultTemplate(q[12]);
                        break block40;
                    }
                    catch (Exception exception) {
                        throw PolicyService.a(exception);
                    }
                }
                stringArray = q;
                soapFaultLevel.setFaultTemplate(stringArray[45]);
            }
            policyEnforcementContext.setFaultlevel(soapFaultLevel);
            policyEnforcementContext.setPolicyResult(AssertionStatus.AUTH_FAILED);
            stringArray = q;
            a.fine(stringArray[36]);
            return;
        }
        try {
            String string3 = string2 + "|" + serviceInfo.getVersion();
            message.initialize(this.a((Document)object, string3, string, bl2));
            policyEnforcementContext.setPolicyResult(AssertionStatus.NONE);
        }
        catch (GeneralSecurityException generalSecurityException) {
            message.initialize(this.a(soapVersion, generalSecurityException));
            stringArray = q;
            a.log(Level.WARNING, stringArray[27] + ExceptionUtils.getMessage((Throwable)generalSecurityException), ExceptionUtils.getDebugException((Throwable)generalSecurityException));
            policyEnforcementContext.setPolicyResult(AssertionStatus.SERVER_ERROR);
        }
        catch (DecoratorException decoratorException) {
            message.initialize(this.a(soapVersion, (Exception)((Object)decoratorException)));
            a.log(Level.WARNING, q[27] + ExceptionUtils.getMessage((Throwable)decoratorException), ExceptionUtils.getDebugException((Throwable)decoratorException));
            policyEnforcementContext.setPolicyResult(AssertionStatus.SERVER_ERROR);
        }
    }

    private Document a(Document document, String string, String string2, boolean bl2) throws GeneralSecurityException, DecoratorException {
        try {
            Document document2;
            block8: {
                Element element;
                block7: {
                    String string3 = SoapConstants.WSX_NAMESPACE;
                    String string4 = SoapConstants.L7_MESSAGEID_NAMESPACE;
                    String string5 = SoapConstants.L7_POLICYVERSION_ELEMENT;
                    String[] stringArray = q;
                    document2 = XmlUtil.stringToDocument((String)(stringArray[41] + string5 + stringArray[5] + string4 + stringArray[46] + string3 + stringArray[28]));
                    element = SoapUtil.getHeaderElement((Document)document2);
                    Element element2 = DomUtils.findFirstChildElement((Element)element);
                    element2.appendChild(DomUtils.createTextNode((Node)document2, (String)string));
                    Element element3 = SoapUtil.getBodyElement((Document)document2);
                    Element element4 = DomUtils.findFirstChildElement((Element)element3);
                    element4.appendChild(document2.importNode(document.getDocumentElement(), true));
                    Element element5 = null;
                    if (string2 != null) {
                        element5 = SoapUtil.setL7aRelatesTo((Document)document2, (String)string2);
                    }
                    try {
                        if (!bl2) break block7;
                        this.a(document2, element2, element5, this.i.getServerSslInfo());
                        break block8;
                    }
                    catch (SAXException sAXException) {
                        throw PolicyService.a(sAXException);
                    }
                }
                SoapUtil.addTimestamp((Element)element, (String)SoapConstants.WSU_NAMESPACE, null, (long)0L, (int)0);
            }
            return document2;
        }
        catch (SAXException sAXException) {
            throw new RuntimeException(sAXException);
        }
        catch (InvalidDocumentFormatException invalidDocumentFormatException) {
            throw new RuntimeException(invalidDocumentFormatException);
        }
        catch (IOException iOException) {
            throw new SignatureException(q[0] + ExceptionUtils.getMessage((Throwable)iOException), iOException);
        }
    }

    private void a(Document document, Element element, Element element2, SsgKeyEntry ssgKeyEntry) throws GeneralSecurityException, DecoratorException {
        WssDecoratorImpl wssDecoratorImpl = new WssDecoratorImpl();
        DecorationRequirements decorationRequirements = new DecorationRequirements();
        decorationRequirements.setSenderMessageSigningCertificate(ssgKeyEntry.getCertificate());
        decorationRequirements.setSenderMessageSigningPrivateKey(ssgKeyEntry.getPrivate());
        decorationRequirements.setSignTimestamp(true);
        try {
            decorationRequirements.getElementsToSign().add(SoapUtil.getBodyElement((Document)document));
            if (element != null) {
                decorationRequirements.getElementsToSign().add(element);
            }
            try {
                if (element2 != null) {
                    decorationRequirements.getElementsToSign().add(element2);
                }
            }
            catch (InvalidDocumentFormatException invalidDocumentFormatException) {
                throw PolicyService.a((Exception)((Object)invalidDocumentFormatException));
            }
            wssDecoratorImpl.decorateMessage(new Message(document), decorationRequirements);
        }
        catch (InvalidDocumentFormatException invalidDocumentFormatException) {
            throw new RuntimeException(invalidDocumentFormatException);
        }
        catch (SAXException sAXException) {
            throw new RuntimeException(sAXException);
        }
        catch (IOException iOException) {
            throw new RuntimeException(iOException);
        }
    }

    private String a(Document document) throws InvalidDocumentFormatException {
        String string;
        Element element = SoapUtil.getHeaderElement((Document)document);
        try {
            if (element == null) {
                throw new MissingRequiredElementException(q[3]);
            }
        }
        catch (InvalidDocumentFormatException invalidDocumentFormatException) {
            throw PolicyService.a((Exception)((Object)invalidDocumentFormatException));
        }
        Element element2 = DomUtils.findOnlyOneChildElementByName((Element)element, (String)SoapConstants.L7_MESSAGEID_NAMESPACE, (String)SoapConstants.L7_CLIENTVERSION_ELEMENT);
        if (element2 == null) {
            String[] stringArray = q;
            string = stringArray[31];
        } else {
            string = DomUtils.getTextValue((Element)element2).trim();
        }
        try {
            if (string.length() < 1) {
                throw new InvalidDocumentFormatException(SoapConstants.L7_CLIENTVERSION_ELEMENT + q[40]);
            }
        }
        catch (InvalidDocumentFormatException invalidDocumentFormatException) {
            throw PolicyService.a((Exception)((Object)invalidDocumentFormatException));
        }
        return string;
    }

    private String b(Document document) throws InvalidDocumentFormatException {
        String string;
        block16: {
            Element element = SoapUtil.getHeaderElement((Document)document);
            try {
                if (element == null) {
                    throw new MissingRequiredElementException(q[32]);
                }
            }
            catch (InvalidDocumentFormatException invalidDocumentFormatException) {
                throw PolicyService.a((Exception)((Object)invalidDocumentFormatException));
            }
            Element element2 = DomUtils.findOnlyOneChildElementByName((Element)element, (String)SoapConstants.L7_MESSAGEID_NAMESPACE, (String)SoapConstants.L7_SERVICEID_ELEMENT);
            try {
                if (element2 == null) {
                    throw new MissingRequiredElementException(q[10] + SoapConstants.L7_MESSAGEID_NAMESPACE + "}" + SoapConstants.L7_SERVICEID_ELEMENT + q[25]);
                }
            }
            catch (InvalidDocumentFormatException invalidDocumentFormatException) {
                throw PolicyService.a((Exception)((Object)invalidDocumentFormatException));
            }
            string = DomUtils.getTextValue((Element)element2);
            try {
                try {
                    if (string != null && string.length() >= 1) break block16;
                }
                catch (InvalidDocumentFormatException invalidDocumentFormatException) {
                    throw PolicyService.a((Exception)((Object)invalidDocumentFormatException));
                }
                throw new InvalidDocumentFormatException(SoapConstants.L7_SERVICEID_ELEMENT + q[37]);
            }
            catch (InvalidDocumentFormatException invalidDocumentFormatException) {
                throw PolicyService.a((Exception)((Object)invalidDocumentFormatException));
            }
        }
        Element element = SoapUtil.getBodyElement((Document)document);
        try {
            if (element == null) {
                throw new MissingRequiredElementException(q[43]);
            }
        }
        catch (InvalidDocumentFormatException invalidDocumentFormatException) {
            throw PolicyService.a((Exception)((Object)invalidDocumentFormatException));
        }
        String[] stringArray = q;
        Element element3 = DomUtils.findOnlyOneChildElementByName((Element)element, (String)SoapConstants.WSX_NAMESPACE, (String)stringArray[49]);
        try {
            if (element3 == null) {
                throw new MissingRequiredElementException(stringArray[17]);
            }
        }
        catch (InvalidDocumentFormatException invalidDocumentFormatException) {
            throw PolicyService.a((Exception)((Object)invalidDocumentFormatException));
        }
        return string;
    }

    private Document a(SoapVersion soapVersion, Exception exception) {
        a.log(Level.FINE, q[22] + ExceptionUtils.getMessage((Throwable)exception), ExceptionUtils.getDebugException((Throwable)exception));
        try {
            Document document = exception instanceof SoapFaultDetail ? SoapFaultUtils.generateSoapFaultDocument((SoapVersion)soapVersion, (SoapFaultDetail)((SoapFaultDetail)exception), (String)SoapUtil.FC_SERVER) : SoapFaultUtils.generateSoapFaultDocument((SoapVersion)soapVersion, (String)SoapUtil.FC_SERVER, (String)exception.getMessage(), null, (String)exception.getClass().getName());
            return document;
        }
        catch (IOException iOException) {
            throw new RuntimeException(iOException);
        }
        catch (SAXException sAXException) {
            throw new RuntimeException(sAXException);
        }
    }

    ServerAssertion a(Assertion assertion, boolean bl2) throws ServerPolicyException {
        AllAssertion allAssertion;
        OneOrMoreAssertion oneOrMoreAssertion;
        AllAssertion allAssertion2;
        block20: {
            allAssertion2 = new AllAssertion();
            try {
                allAssertion2.addChild((Assertion)new OneOrMoreAssertion(this.f));
                if (bl2) {
                    allAssertion2.addChild((Assertion)RequireWssTimestamp.newInstance());
                }
            }
            catch (LicenseException licenseException) {
                throw PolicyService.a((Exception)((Object)licenseException));
            }
            if (!b) {
                block19: {
                    oneOrMoreAssertion = new OneOrMoreAssertion();
                    try {
                        oneOrMoreAssertion.addChild((Assertion)new RequireWssSignedElement(new XpathExpression(q[11], "s", q[19])));
                        oneOrMoreAssertion.addChild((Assertion)new RequireWssSignedElement(new XpathExpression(q[44], "s", q[39])));
                        allAssertion2.addChild((Assertion)oneOrMoreAssertion);
                        if (!c) break block19;
                        allAssertion2.addChild((Assertion)new RequireWssSignedElement(new XpathExpression(q[2] + SoapUtil.L7_MESSAGEID_NAMESPACE + q[50])));
                        break block20;
                    }
                    catch (LicenseException licenseException) {
                        throw PolicyService.a((Exception)((Object)licenseException));
                    }
                }
                String[] stringArray = q;
                allAssertion2.addChild((Assertion)new RequireWssSignedElement(new XpathExpression(stringArray[23] + SoapUtil.L7_MESSAGEID_NAMESPACE + stringArray[51] + SoapUtil.L7_SERVICEID_ELEMENT + stringArray[16])));
            }
        }
        oneOrMoreAssertion = new AllAssertion();
        try {
            if (!b) {
                oneOrMoreAssertion.addChild((Assertion)new SslAssertion());
            }
        }
        catch (LicenseException licenseException) {
            throw PolicyService.a((Exception)((Object)licenseException));
        }
        oneOrMoreAssertion.addChild((Assertion)new OneOrMoreAssertion(this.g));
        if (d) {
            allAssertion = new AllAssertion();
            allAssertion.addChild((Assertion)new SslAssertion());
            allAssertion.addChild((Assertion)new OneOrMoreAssertion(Arrays.asList(new RequestWssKerberos())));
        } else {
            allAssertion = null;
        }
        OneOrMoreAssertion oneOrMoreAssertion2 = new OneOrMoreAssertion();
        try {
            oneOrMoreAssertion2.addChild((Assertion)allAssertion2);
            oneOrMoreAssertion2.addChild((Assertion)oneOrMoreAssertion);
            if (allAssertion != null) {
                oneOrMoreAssertion2.addChild((Assertion)allAssertion);
            }
        }
        catch (LicenseException licenseException) {
            throw PolicyService.a((Exception)((Object)licenseException));
        }
        AllAssertion allAssertion3 = new AllAssertion();
        allAssertion3.addChild((Assertion)oneOrMoreAssertion2);
        ArrayList<Assertion> arrayList = new ArrayList<Assertion>();
        try {
            this.a(assertion, arrayList);
            if (arrayList.size() > 0) {
                allAssertion3.addChild((Assertion)new OneOrMoreAssertion(arrayList));
            }
        }
        catch (LicenseException licenseException) {
            throw PolicyService.a((Exception)((Object)licenseException));
        }
        try {
            Assertion.filterOutDisabledAssertions((Assertion)allAssertion3);
            return this.j.compilePolicy((Assertion)allAssertion3, false);
        }
        catch (LicenseException licenseException) {
            throw new RuntimeException(licenseException);
        }
    }

    private void a(Assertion assertion, List<Assertion> list) {
        block11: {
            try {
                if (!assertion.isEnabled()) {
                    return;
                }
            }
            catch (IllegalArgumentException illegalArgumentException) {
                throw PolicyService.a(illegalArgumentException);
            }
            try {
                try {
                    if (!(assertion instanceof IdentityAssertion) || !Assertion.isRequest((Assertion)assertion)) break block11;
                }
                catch (IllegalArgumentException illegalArgumentException) {
                    throw PolicyService.a(illegalArgumentException);
                }
                list.add(assertion);
            }
            catch (IllegalArgumentException illegalArgumentException) {
                throw PolicyService.a(illegalArgumentException);
            }
        }
        try {
            if (!(assertion instanceof CompositeAssertion)) {
                return;
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw PolicyService.a(illegalArgumentException);
        }
        CompositeAssertion compositeAssertion = (CompositeAssertion)assertion;
        for (Object e10 : compositeAssertion.getChildren()) {
            Assertion assertion2 = (Assertion)e10;
            this.a(assertion2, list);
        }
    }

    /*
     * Loose catch block
     */
    private boolean a(Assertion assertion) throws InterruptedException, PolicyAssertionException {
        PolicyPathResult policyPathResult;
        Assertion assertion2;
        block14: {
            block15: {
                assertion2 = new HideDisabledAssertions().filter(null, assertion);
                try {
                    if (assertion2 != null) break block14;
                    if (!(assertion instanceof CompositeAssertion)) break block15;
                }
                catch (PolicyTooComplexException policyTooComplexException) {
                    throw PolicyService.a((Exception)((Object)policyTooComplexException));
                }
                CompositeAssertion compositeAssertion = (CompositeAssertion)assertion;
                if (!compositeAssertion.isEmpty()) break block15;
                try {
                    block16: {
                        if (!compositeAssertion.permitsEmpty()) break block15;
                        break block16;
                        catch (PolicyTooComplexException policyTooComplexException) {
                            throw PolicyService.a((Exception)((Object)policyTooComplexException));
                        }
                    }
                    return true;
                }
                catch (PolicyTooComplexException policyTooComplexException) {
                    throw PolicyService.a((Exception)((Object)policyTooComplexException));
                }
            }
            return false;
        }
        try {
            policyPathResult = this.m.makePathBuilder().generate(assertion2);
        }
        catch (PolicyTooComplexException policyTooComplexException) {
            a.log(Level.INFO, q[7]);
            return false;
        }
        for (AssertionPath assertionPath : policyPathResult.paths()) {
            Assertion[] assertionArray = assertionPath.getPath();
            boolean bl2 = false;
            for (Assertion assertion3 : assertionArray) {
                try {
                    if (!(assertion3 instanceof IdentityAssertion) || !Assertion.isRequest((Assertion)assertion3)) continue;
                }
                catch (PolicyTooComplexException policyTooComplexException) {
                    throw PolicyService.a((Exception)((Object)policyTooComplexException));
                }
                bl2 = true;
            }
            try {
                if (bl2) continue;
                return true;
            }
            catch (PolicyTooComplexException policyTooComplexException) {
                throw PolicyService.a((Exception)((Object)policyTooComplexException));
            }
        }
        return false;
    }

    /*
     * Unable to fully structure code
     */
    static {
        block10: {
            block9: {
                var5 = new String[52];
                var3_1 = 0;
                var2_2 = "gnb/sQeFo#>vS+\u0012pl!vW<\b :Qoncs\u00031WckclQ7Deqco[)[czco[)[cz\u001ezF3[cf\bqU'^eO(xU&KKf?}Q7]sH\u001d*X!pW$^-m,rQm\u001b=$\bqB ^os(8ij\u0018[o\"|U)\u001fnb z\u001cl\u000f'K(~P @'^b5o+Smf>oU&W-v?v\u001cl\u000f'(|o#\u001ePu\u0015\u0012Hf,{Q7\u0012wb>?R*GngmvZeFhfmmQ4Gep91\u001aboo$|Meta`9pF<\u0012ipmmQ4Giq({\f\u0012xn!qG\u007f~7bp=\u001dAeq;vW \u001cvb!vP$FeT>l`,_ep9~Y5A^boo$|MeFolm|[(Blf5?@*\u0012am,sM?W .`?U6Aun$qSe[t#.pZ1Sim>?Z*\u0012pb9wGeSlo\"h]+U v#~A1Zem9vW$Fegm~W&Wsp$fhfmo[)[czm{[ A m\"k\u0014$^ll:?U+]nz pA6\u001c#Qam#p@eTim)?@$@gf9?D*^i`4?R7]m#${\u000ee\u0004|o#6\u0012\u001ds9\bqB ^os(0G\u007fpog4\u0231\u000e?{ s\u00143Wrp$pZx\u00101-}=\u0014 \\cl)vZ\"\u000f\"V\u0019Y\u0019}\u0010?=G#G*Spf#i\u000e\u0000\\vf!pD \u0012xn!qG\u007fAob=zZ3\u000f\"k9kD\u007f\u001d/t:h\u001a2\u0001.l?x\u001bw\u000200b/\u0001jAob=2Q+Deo\"oQg\u0012 #m?\u0014e\u0012 #m?\u0014e\u0012 #m?L(^npws\u0003x\u0010hw9o\u000ej\u001dwt:1X$KeqzkQ&Z.`\"r\u001b2A/s\"s]&K/e,jX1\u0010>\tm?\u0014e\u000esl,oQ+D:A\"{M{8 #m?\u0014e\u0012 ?>pU5WnuwYU0^t=G?\u0014e\u0012 #m?\u0014e\u0012 ?>pU5Wnuw\\[!W>\tm?\u0014e\u0012 #m?\u0014e\u0012 #m?\b6]as(qB\u007fdao8z\n6]as(qB\u007f`e`(vB @<,>pU5WnuwIU)Ge=G?\u0014e\u0012 #m?\u0014e\u0012 ?bl[$Bem;%w*Ve=G?\u0014e\u0012 #m?\u0014e\u0012 ?>pU5WnuwMQ$Aoms\u0015\u0014e\u0012 #m?\u0014e\u0012 #m?\u0014e\u000esl,oQ+D:W(g@eJmowsU+U=!(q\u0019\u0010a\"=8qU0Fhl?vN V s\"s]&K g\"hZ)]agq0G*Spf#i\u000e\u0011Wxws\u0015\u0014e\u0012 #m?\u0014e\u0012 #q0G*Spf#i\u000e\u0017Wap\"q\nO\u0012 #m?\u0014e\u0012<,>pU5WnuwYU0^t=G?\u0014e\u0012<,>pU5Wnuw][!K>\tq0G*Spf#i\u000e\u0000\\vf!pD \f\u0007Boo$|Me8Qoncs\u00031WckclQ7Deqco[)[czco[)[cz\u001ezF3[cf\u000bjX)ae`8m]1KCk(|_6\u001eaeq;zFeQeq9?R,\\df??]6\u0012rf<j]7Wd\u0002\u0015]'`er8zG1\u0012wb>?Z*F bmhG=\bGf9O[)[czmmQ4Gep9\u0011Ztw=[]\"WswczZ$Plf)Ztw=%\u001bjAck(rU6\u001cxn!l[$B.l?x\u001b6]asbzZ3Wll=z\u001b\u001dAeq;vW \u001cvb!vP$FeT>l`,_ep9~Y5A8Qoncs\u00031WckclQ7Deqco[)[czco[)[cz\u001ezF3[cf\u001et]5ae`8m]1KCk(|_6\u0017puj!{]+U e,jX1\u0012dv(?@*\b H\u001d*X!pW$^-m,rQm\u001b=$\bqB ^os(8ij\u0018[o\"|U)\u001fnb z\u001cl\u000f'K(~P @'^b5o+Smf>oU&W-v?v\u001cl\u000f'\u001cBrl/sQ(\u0012pq(oU7[ndmmQ6Bom>z\u000ee&\u0012eo(rQ+F t,l\u0014#]um)?]+\u0012tk(?g\nsP#%zU!Wr-\u0014boo$|Me@er8zG1Wd#$l\u0014\u001cBrl/sQ(\u0012pq(oU7[ndmmQ6Bom>z\u000ee\u001f\u0010/=q0G*Sp9\u000fpP<\f<,>pU5\bEm;zX*Be=&Brl/sQ(\u0012rv#q]+U s\"s]&K g\"hZ)]agmo[)[cz\u0012qom+vSe[s#?zE0[rf)\u0003\u0007.3(|o#\u001ePu\u0015\u0012Hf,{Q7\u0012wb>?R*GngmvZeFhfmmQ4Gep91\n\u0012nl9?R*Gng\u0014`um#vZ\"\u0012mf9~\u00195]lj.f\u001a\u0014\u0012fl??W)[em9?B @sj\"q\u0014\u0019@ep8s@,\\g#=pX,Qy#$l\u0014 _pw4\u0013\u0012eo(rQ+F t,l\u0014 _pw41&Brl/sQ(\u0012rv#q]+U s\"s]&K g\"hZ)]agmo[)[cz'Ztw=%\u001bjEwtch\u0007k]rdb-\u0004u\u0001/3x0G*Sp.(qB ^os(\u0013\u0012eo(rQ+F t,l\u0014 _pw41X\u000esl,o\u000e\u0000\\vf!pD \u0012xn!qG\u007fAob=\"\u0016-Ftsw0\u001b6Qhf ~GkJmo>pU5\u001coq*0G*Sp,(qB ^os(0\u0016{\u000esl,o\u000e\rWag(m\ny~7bw\u001atio9zFe\u007fam,xQ7\u0012ipmmQ4Giq({&|o#\u001ePu\u0015\u0012Bl)f\u00142Ss#+pA+V j#?@-W q(nA At-\u0012\u001ds9\bqB ^os(0G\u007fpog4\u0194\u000e?{ s\u00143Wrp$pZx\u00101-}=\u0014 \\cl)vZ\"\u000f\"V\u0019Y\u0019}\u0010?=G#G*Spf#i\u000e\u0000\\vf!pD \u0012xn!qG\u007fAob=zZ3\u000f\"k9kD\u007f\u001d/p.wQ(Ss-5rX6]ascpF\"\u001dsl,o\u001b \\vf!pD \u001d\"#m?\u0014e\u0012 #m?\u0014e\u0012 #m?\u0014eJmo#l\u000e)\u0005=!%k@5\b/,:hCk^az(m\u00031Wckc|[(\u001dwpbo[)[czbyU0^t!s\u0015\u0014e\u0012 ?>pU5Wnuw][!K>\tm?\u0014e\u0012 #m#G*Spf#i\u000e\u0003Suo9!>e\u0012 #m?\u0014e\u0012 #m#R$Glw.pP \fSf?iQ7\u000e/e,jX1Qog(!>e\u0012 #m?\u0014e\u0012 #m#R$Glw>kF,\\g=8qU0Fhl?vN V s\"s]&K g\"hZ)]agq0R$Glw>kF,\\g=G?\u0014e\u0012 #m?\bjAob=zZ3\bFb8s@{8 #m?\bjAob=zZ3\bBl)f\nO\u000e/p\"~D \\v9\bqB ^os(!>\u0010/=q0G*Sp9\u0005zU!Wr=ql[$B:A\"{M{\u000ewp5%s FPl!vW<`ep=pZ6W { sZ6\bwp5\"\u0016#Qam#p@eTim)?@$@gf9?D*^i`4?R7]m#${\u000ee'boo$|Mebaw%?v0[lg(m\u0014\u0003Scw\"mMe[s#?zE0[rf)\tuew\u001dpX,Qy";
                var4_3 = "gnb/sQeFo#>vS+\u0012pl!vW<\b :Qoncs\u00031WckclQ7Deqco[)[czco[)[cz\u001ezF3[cf\bqU'^eO(xU&KKf?}Q7]sH\u001d*X!pW$^-m,rQm\u001b=$\bqB ^os(8ij\u0018[o\"|U)\u001fnb z\u001cl\u000f'K(~P @'^b5o+Smf>oU&W-v?v\u001cl\u000f'(|o#\u001ePu\u0015\u0012Hf,{Q7\u0012wb>?R*GngmvZeFhfmmQ4Gep91\u001aboo$|Meta`9pF<\u0012ipmmQ4Giq({\f\u0012xn!qG\u007f~7bp=\u001dAeq;vW \u001cvb!vP$FeT>l`,_ep9~Y5A^boo$|MeFolm|[(Blf5?@*\u0012am,sM?W .`?U6Aun$qSe[t#.pZ1Sim>?Z*\u0012pb9wGeSlo\"h]+U v#~A1Zem9vW$Fegm~W&Wsp$fhfmo[)[czm{[ A m\"k\u0014$^ll:?U+]nz pA6\u001c#Qam#p@eTim)?@$@gf9?D*^i`4?R7]m#${\u000ee\u0004|o#6\u0012\u001ds9\bqB ^os(0G\u007fpog4\u0231\u000e?{ s\u00143Wrp$pZx\u00101-}=\u0014 \\cl)vZ\"\u000f\"V\u0019Y\u0019}\u0010?=G#G*Spf#i\u000e\u0000\\vf!pD \u0012xn!qG\u007fAob=zZ3\u000f\"k9kD\u007f\u001d/t:h\u001a2\u0001.l?x\u001bw\u000200b/\u0001jAob=2Q+Deo\"oQg\u0012 #m?\u0014e\u0012 #m?\u0014e\u0012 #m?L(^npws\u0003x\u0010hw9o\u000ej\u001dwt:1X$KeqzkQ&Z.`\"r\u001b2A/s\"s]&K/e,jX1\u0010>\tm?\u0014e\u000esl,oQ+D:A\"{M{8 #m?\u0014e\u0012 ?>pU5WnuwYU0^t=G?\u0014e\u0012 #m?\u0014e\u0012 ?>pU5Wnuw\\[!W>\tm?\u0014e\u0012 #m?\u0014e\u0012 #m?\b6]as(qB\u007fdao8z\n6]as(qB\u007f`e`(vB @<,>pU5WnuwIU)Ge=G?\u0014e\u0012 #m?\u0014e\u0012 ?bl[$Bem;%w*Ve=G?\u0014e\u0012 #m?\u0014e\u0012 ?>pU5WnuwMQ$Aoms\u0015\u0014e\u0012 #m?\u0014e\u0012 #m?\u0014e\u000esl,oQ+D:W(g@eJmowsU+U=!(q\u0019\u0010a\"=8qU0Fhl?vN V s\"s]&K g\"hZ)]agq0G*Spf#i\u000e\u0011Wxws\u0015\u0014e\u0012 #m?\u0014e\u0012 #q0G*Spf#i\u000e\u0017Wap\"q\nO\u0012 #m?\u0014e\u0012<,>pU5WnuwYU0^t=G?\u0014e\u0012<,>pU5Wnuw][!K>\tq0G*Spf#i\u000e\u0000\\vf!pD \f\u0007Boo$|Me8Qoncs\u00031WckclQ7Deqco[)[czco[)[cz\u001ezF3[cf\u000bjX)ae`8m]1KCk(|_6\u001eaeq;zFeQeq9?R,\\df??]6\u0012rf<j]7Wd\u0002\u0015]'`er8zG1\u0012wb>?Z*F bmhG=\bGf9O[)[czmmQ4Gep9\u0011Ztw=[]\"WswczZ$Plf)Ztw=%\u001bjAck(rU6\u001cxn!l[$B.l?x\u001b6]asbzZ3Wll=z\u001b\u001dAeq;vW \u001cvb!vP$FeT>l`,_ep9~Y5A8Qoncs\u00031WckclQ7Deqco[)[czco[)[cz\u001ezF3[cf\u001et]5ae`8m]1KCk(|_6\u0017puj!{]+U e,jX1\u0012dv(?@*\b H\u001d*X!pW$^-m,rQm\u001b=$\bqB ^os(8ij\u0018[o\"|U)\u001fnb z\u001cl\u000f'K(~P @'^b5o+Smf>oU&W-v?v\u001cl\u000f'\u001cBrl/sQ(\u0012pq(oU7[ndmmQ6Bom>z\u000ee&\u0012eo(rQ+F t,l\u0014#]um)?]+\u0012tk(?g\nsP#%zU!Wr-\u0014boo$|Me@er8zG1Wd#$l\u0014\u001cBrl/sQ(\u0012pq(oU7[ndmmQ6Bom>z\u000ee\u001f\u0010/=q0G*Sp9\u000fpP<\f<,>pU5\bEm;zX*Be=&Brl/sQ(\u0012rv#q]+U s\"s]&K g\"hZ)]agmo[)[cz\u0012qom+vSe[s#?zE0[rf)\u0003\u0007.3(|o#\u001ePu\u0015\u0012Hf,{Q7\u0012wb>?R*GngmvZeFhfmmQ4Gep91\n\u0012nl9?R*Gng\u0014`um#vZ\"\u0012mf9~\u00195]lj.f\u001a\u0014\u0012fl??W)[em9?B @sj\"q\u0014\u0019@ep8s@,\\g#=pX,Qy#$l\u0014 _pw4\u0013\u0012eo(rQ+F t,l\u0014 _pw41&Brl/sQ(\u0012rv#q]+U s\"s]&K g\"hZ)]agmo[)[cz'Ztw=%\u001bjEwtch\u0007k]rdb-\u0004u\u0001/3x0G*Sp.(qB ^os(\u0013\u0012eo(rQ+F t,l\u0014 _pw41X\u000esl,o\u000e\u0000\\vf!pD \u0012xn!qG\u007fAob=\"\u0016-Ftsw0\u001b6Qhf ~GkJmo>pU5\u001coq*0G*Sp,(qB ^os(0\u0016{\u000esl,o\u000e\rWag(m\ny~7bw\u001atio9zFe\u007fam,xQ7\u0012ipmmQ4Giq({&|o#\u001ePu\u0015\u0012Bl)f\u00142Ss#+pA+V j#?@-W q(nA At-\u0012\u001ds9\bqB ^os(0G\u007fpog4\u0194\u000e?{ s\u00143Wrp$pZx\u00101-}=\u0014 \\cl)vZ\"\u000f\"V\u0019Y\u0019}\u0010?=G#G*Spf#i\u000e\u0000\\vf!pD \u0012xn!qG\u007fAob=zZ3\u000f\"k9kD\u007f\u001d/p.wQ(Ss-5rX6]ascpF\"\u001dsl,o\u001b \\vf!pD \u001d\"#m?\u0014e\u0012 #m?\u0014e\u0012 #m?\u0014eJmo#l\u000e)\u0005=!%k@5\b/,:hCk^az(m\u00031Wckc|[(\u001dwpbo[)[czbyU0^t!s\u0015\u0014e\u0012 ?>pU5Wnuw][!K>\tm?\u0014e\u0012 #m#G*Spf#i\u000e\u0003Suo9!>e\u0012 #m?\u0014e\u0012 #m#R$Glw.pP \fSf?iQ7\u000e/e,jX1Qog(!>e\u0012 #m?\u0014e\u0012 #m#R$Glw>kF,\\g=8qU0Fhl?vN V s\"s]&K g\"hZ)]agq0R$Glw>kF,\\g=G?\u0014e\u0012 #m?\bjAob=zZ3\bFb8s@{8 #m?\bjAob=zZ3\bBl)f\nO\u000e/p\"~D \\v9\bqB ^os(!>\u0010/=q0G*Sp9\u0005zU!Wr=ql[$B:A\"{M{\u000ewp5%s FPl!vW<`ep=pZ6W { sZ6\bwp5\"\u0016#Qam#p@eTim)?@$@gf9?D*^i`4?R7]m#${\u000ee'boo$|Mebaw%?v0[lg(m\u0014\u0003Scw\"mMe[s#?zE0[rf)\tuew\u001dpX,Qy".length();
                var1_4 = 23;
                var0_5 = -1;
lbl7:
                // 2 sources

                while (true) {
                    v0 = 49;
                    v1 = ++var0_5;
                    v2 = var2_2.substring(v1, v1 + var1_4);
                    v3 = -1;
                    break block9;
                    break;
                }
lbl13:
                // 1 sources

                while (true) {
                    var5[var3_1++] = PolicyService.a(v0, PolicyService.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "9q\u00149\fN\u000fW8\u0005qON\r\u001ev\bsI\u0007H\u000e?";
                    var4_3 = "9q\u00149\fN\u000fW8\u0005qON\r\u001ev\bsI\u0007H\u000e?".length();
                    var1_4 = 2;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 29;
                        v4 = ++var0_5;
                        v2 = var2_2.substring(v4, v4 + var1_4);
                        v3 = 0;
                        break block9;
                        break;
                    }
                    break;
                }
lbl28:
                // 1 sources

                while (true) {
                    var5[var3_1++] = PolicyService.a(v0, PolicyService.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    break block10;
                    break;
                }
            }
            switch (v3) {
                default: {
                    ** continue;
                }
                ** case 0:
lbl39:
                // 1 sources

                ** continue;
            }
        }
        PolicyService.q = var5;
        PolicyService.e = PolicyService.q[20];
        PolicyService.a = Logger.getLogger(PolicyService.class.getName());
        var0_6 = PolicyService.q;
        PolicyService.b = ConfigFactory.getBooleanProperty((String)var0_6[21], (boolean)false);
        PolicyService.c = ConfigFactory.getBooleanProperty((String)var0_6[14], (boolean)false);
        PolicyService.d = ConfigFactory.getBooleanProperty((String)var0_6[1], (boolean)false);
        PolicyService.o = new Assertion[]{RequireWssSaml.newHolderOfKey(), new RequireWssX509Cert(), new SecureConversation(), new RequestWssKerberos()};
        PolicyService.p = new Assertion[]{new WssBasic(), new HttpBasic(), new SslAssertion(true)};
    }

    private static Exception a(Exception exception) {
        return exception;
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x74);
        }
        return cArray;
    }

    /*
     * Handled impossible loop by duplicating code
     * Enabled aggressive block sorting
     */
    private static String a(int n2, char[] cArray) {
        char[] cArray2;
        block11: {
            int n3;
            int n4;
            int n5;
            block10: {
                n5 = n2;
                cArray2 = cArray;
                n4 = cArray.length;
                n3 = 0;
                if (!true) break block10;
                n4 = n4;
                if (n4 <= n3) break block11;
            }
            do {
                n5 = n5;
                cArray2 = cArray2;
                int n6 = n3;
                cArray2[n6] = (char)(cArray2[n6] ^ (n5 ^ (switch (n3 % 7) {
                    case 0 -> 3;
                    case 1 -> 49;
                    case 2 -> 50;
                    case 3 -> 124;
                    case 4 -> 46;
                    case 5 -> 5;
                    default -> 116;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }

    public static interface PolicyGetter {
        public ServiceInfo getPolicy(String var1);
    }

    public static interface ServiceInfo {
        public Assertion getPolicy() throws PolicyAssertionException;

        public String getVersion();
    }
}

