/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.common.io.CertUtils
 *  com.l7tech.common.io.XmlUtil
 *  com.l7tech.gateway.common.audit.AssertionMessages
 *  com.l7tech.gateway.common.audit.Audit
 *  com.l7tech.gateway.common.audit.AuditDetailMessage
 *  com.l7tech.objectmodel.FindException
 *  com.l7tech.objectmodel.Goid
 *  com.l7tech.policy.variable.NoSuchVariableException
 *  com.l7tech.security.cert.KeyUsageActivity
 *  com.l7tech.security.cert.KeyUsageChecker
 *  com.l7tech.security.cert.TrustedCert
 *  com.l7tech.security.xml.DsigUtil
 *  com.l7tech.security.xml.DsigValidity
 *  com.l7tech.security.xml.KeyInfoElement$UnsupportedKeyInfoFormatException
 *  com.l7tech.security.xml.SecurityTokenResolver
 *  com.l7tech.security.xml.SignatureValidityContext$Builder
 *  com.l7tech.security.xml.XmlElementVerifierConfig
 *  com.l7tech.util.ConfigFactory
 *  com.l7tech.util.DomUtils
 *  com.l7tech.util.ExceptionUtils
 *  com.l7tech.util.HexUtils
 *  com.l7tech.util.InvalidDocumentFormatException
 *  com.l7tech.util.MissingRequiredElementException
 *  com.l7tech.util.SoapConstants
 *  com.l7tech.xml.InvalidDocumentSignatureException
 *  com.l7tech.xml.soap.SoapUtil
 *  org.jaxen.JaxenException
 *  org.jaxen.dom.DOMXPath
 *  org.jetbrains.annotations.NotNull
 *  org.jetbrains.annotations.Nullable
 */
package com.l7tech.server.security;

import com.l7tech.common.io.CertUtils;
import com.l7tech.common.io.XmlUtil;
import com.l7tech.gateway.common.audit.AssertionMessages;
import com.l7tech.gateway.common.audit.Audit;
import com.l7tech.gateway.common.audit.AuditDetailMessage;
import com.l7tech.objectmodel.FindException;
import com.l7tech.objectmodel.Goid;
import com.l7tech.policy.variable.NoSuchVariableException;
import com.l7tech.security.cert.KeyUsageActivity;
import com.l7tech.security.cert.KeyUsageChecker;
import com.l7tech.security.cert.TrustedCert;
import com.l7tech.security.xml.DsigUtil;
import com.l7tech.security.xml.DsigValidity;
import com.l7tech.security.xml.KeyInfoElement;
import com.l7tech.security.xml.SecurityTokenResolver;
import com.l7tech.security.xml.SignatureValidityContext;
import com.l7tech.security.xml.XmlElementVerifierConfig;
import com.l7tech.server.identity.cert.TrustedCertCache;
import com.l7tech.util.ConfigFactory;
import com.l7tech.util.DomUtils;
import com.l7tech.util.ExceptionUtils;
import com.l7tech.util.HexUtils;
import com.l7tech.util.InvalidDocumentFormatException;
import com.l7tech.util.MissingRequiredElementException;
import com.l7tech.util.SoapConstants;
import com.l7tech.xml.InvalidDocumentSignatureException;
import com.l7tech.xml.soap.SoapUtil;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.math.BigInteger;
import java.security.SignatureException;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
import javax.security.auth.x500.X500Principal;
import javax.xml.crypto.dsig.Reference;
import org.jaxen.JaxenException;
import org.jaxen.dom.DOMXPath;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.w3c.dom.Element;

/*
 * Exception performing whole class analysis ignored.
 */
public class XmlElementVerifier {
    static final String a;
    public static boolean CERT_PARSE_BC_FALLBACK;
    private final XmlElementVerifierConfig b;
    private final SecurityTokenResolver c;
    private final TrustedCertCache d;
    private final Audit e;
    private final Logger f;
    private final X509Certificate g;
    private static final DOMXPath h;
    private static final String[] i;

    public XmlElementVerifier(XmlElementVerifierConfig xmlElementVerifierConfig, SecurityTokenResolver securityTokenResolver, TrustedCertCache trustedCertCache, Audit audit, Logger logger) throws CertificateException {
        this.b = xmlElementVerifierConfig;
        this.c = securityTokenResolver;
        this.d = trustedCertCache;
        this.e = audit;
        this.f = logger;
        this.g = this.a();
    }

    public List<Object[]> verifySignature(@NotNull Element element, @NotNull Map<String, Element> map, @Nullable Map<String, Object> map2) throws Exception {
        String string;
        Object object2;
        String string2;
        String string3;
        DsigValidity dsigValidity;
        X509Certificate x509Certificate;
        block53: {
            block56: {
                Element element2;
                block51: {
                    block49: {
                        block50: {
                            try {
                                if (element == null) {
                                    XmlElementVerifier.a(0);
                                }
                            }
                            catch (Exception exception) {
                                throw XmlElementVerifier.a(exception);
                            }
                            try {
                                if (map == null) {
                                    XmlElementVerifier.a(1);
                                }
                            }
                            catch (Exception exception) {
                                throw XmlElementVerifier.a(exception);
                            }
                            element2 = DsigUtil.searchForKeyInfo((Element)element);
                            try {
                                try {
                                    try {
                                        if (this.g == null) break block49;
                                        if (this.b.isIgnoreKeyInfo()) break block50;
                                    }
                                    catch (Exception exception) {
                                        throw XmlElementVerifier.a(exception);
                                    }
                                    if (element2 == null) break block50;
                                }
                                catch (Exception exception) {
                                    throw XmlElementVerifier.a(exception);
                                }
                                if (!this.b.getXAdESEnabled()) break block49;
                            }
                            catch (Exception exception) {
                                throw XmlElementVerifier.a(exception);
                            }
                        }
                        x509Certificate = this.g;
                        break block56;
                    }
                    try {
                        block52: {
                            try {
                                try {
                                    try {
                                        if (this.b.getVerifyCertificateVariableName() == null) break block51;
                                        if (this.b.isIgnoreKeyInfo()) break block52;
                                    }
                                    catch (Exception exception) {
                                        throw XmlElementVerifier.a(exception);
                                    }
                                    if (element2 == null) break block52;
                                }
                                catch (Exception exception) {
                                    throw XmlElementVerifier.a(exception);
                                }
                                if (!this.b.getXAdESEnabled()) break block51;
                            }
                            catch (Exception exception) {
                                throw XmlElementVerifier.a(exception);
                            }
                        }
                        if (map2 == null) break block51;
                    }
                    catch (Exception exception) {
                        throw XmlElementVerifier.a(exception);
                    }
                    x509Certificate = this.a(map2);
                    break block56;
                }
                try {
                    if (element2 == null) {
                        throw new InvalidDocumentFormatException(i[32]);
                    }
                }
                catch (Exception exception) {
                    throw XmlElementVerifier.a(exception);
                }
                x509Certificate = this.a(element2, this.c);
            }
            try {
                if (x509Certificate == null) {
                    throw new SignatureException(i[27]);
                }
            }
            catch (Exception exception) {
                throw XmlElementVerifier.a(exception);
            }
            KeyUsageChecker.requireActivity((KeyUsageActivity)KeyUsageActivity.verifyXml, (X509Certificate)x509Certificate);
            x509Certificate.checkValidity();
            dsigValidity = new SignatureValidityContext.Builder(element, x509Certificate, this.b.getXAdESEnabled()).usesElementIdMapping(map).build().verify();
            try {
                if (!dsigValidity.getCoreValidity().booleanValue()) {
                    throw new InvalidDocumentSignatureException(dsigValidity.getInvalidSignatureMessage());
                }
            }
            catch (Exception exception) {
                throw XmlElementVerifier.a(exception);
            }
            String[] stringArray = i;
            Element element3 = DomUtils.findOnlyOneChildElementByName((Element)element, (String)element.getNamespaceURI(), (String)stringArray[6]);
            try {
                if (element3 == null) {
                    throw new InvalidDocumentFormatException(stringArray[14]);
                }
            }
            catch (Exception exception) {
                throw XmlElementVerifier.a(exception);
            }
            string3 = XmlUtil.getTextValue((Element)element3);
            string2 = (String)h.selectSingleNode((Object)element);
            try {
                try {
                    if (string2 != null && string2.trim().length() >= 1) break block53;
                }
                catch (Exception exception) {
                    throw XmlElementVerifier.a(exception);
                }
                throw new InvalidDocumentFormatException(i[10]);
            }
            catch (Exception exception) {
                throw XmlElementVerifier.a(exception);
            }
        }
        boolean[] blArray = new boolean[]{false};
        String[] stringArray = new String[]{null};
        for (Object object2 : dsigValidity.getReferences()) {
            String string4;
            block54: {
                string4 = object2.getDigestMethod().getAlgorithm();
                try {
                    try {
                        if (stringArray[0] == null || stringArray[0].equals(string4)) break block54;
                    }
                    catch (Exception exception) {
                        throw XmlElementVerifier.a(exception);
                    }
                    blArray[0] = true;
                }
                catch (Exception exception) {
                    throw XmlElementVerifier.a(exception);
                }
            }
            stringArray[0] = string4;
        }
        try {
            string = blArray[0] ? i[34] : stringArray[0];
        }
        catch (Exception exception) {
            throw XmlElementVerifier.a(exception);
        }
        String string5 = string;
        object2 = new ArrayList();
        int n2 = dsigValidity.getNumberOfReferences();
        for (int i2 = 0; i2 < n2; ++i2) {
            String string6;
            Element element4;
            String string7;
            block55: {
                string7 = ((Reference)dsigValidity.getReferences().get(i2)).getURI();
                try {
                    try {
                        if (string7 == null || string7.length() <= 1) break block55;
                    }
                    catch (Exception exception) {
                        throw XmlElementVerifier.a(exception);
                    }
                    if (string7.charAt(0) != '#') break block55;
                }
                catch (Exception exception) {
                    throw XmlElementVerifier.a(exception);
                }
                string7 = string7.substring(1);
            }
            if ((element4 = map.get(string7)) == null) {
                string6 = i[28] + string7;
                this.f.warning(string6);
                throw new InvalidDocumentFormatException(string6);
            }
            string6 = new Object[]{element4, x509Certificate, string2, string5, string3, element};
            object2.add(string6);
        }
        return object2;
    }

    private X509Certificate a(Map<String, Object> map) throws NoSuchVariableException, IOException, CertificateException {
        String string = this.b.getVerifyCertificateVariableName();
        Object object = map.get(string);
        try {
            if (object == null) {
                throw new NoSuchVariableException(string, i[11]);
            }
        }
        catch (NoSuchVariableException noSuchVariableException) {
            throw XmlElementVerifier.a((Exception)((Object)noSuchVariableException));
        }
        try {
            if (object instanceof X509Certificate) {
                return (X509Certificate)object;
            }
        }
        catch (NoSuchVariableException noSuchVariableException) {
            throw XmlElementVerifier.a((Exception)((Object)noSuchVariableException));
        }
        if (object instanceof String) {
            String string2 = (String)object;
            return CertUtils.decodeFromPEM((String)string2, (boolean)false);
        }
        throw new NoSuchVariableException(string, i[18]);
    }

    /*
     * Unable to fully structure code
     */
    private X509Certificate a() throws CertificateException {
        block14: {
            var1_1 = null;
            var2_2 = "";
            try {
                block15: {
                    block17: {
                        block16: {
                            block18: {
                                block13: {
                                    var3_3 = this.b.getVerifyCertificateGoid();
                                    var4_5 = this.b.getVerifyCertificateName();
                                    try {
                                        if (var3_3 == null || Goid.DEFAULT_GOID.equals((Object)var3_3)) break block13;
                                    }
                                    catch (FindException v0) {
                                        throw XmlElementVerifier.a((Exception)v0);
                                    }
                                    var10_6 = XmlElementVerifier.i;
                                    var2_2 = var10_6[1] + String.valueOf(var3_3);
                                    var5_9 = this.d.findByPrimaryKey(var3_3);
                                    if (var5_9 != null) {
                                        var1_1 = var5_9.getCertificate();
                                        break block14;
                                    }
                                    var10_6 = XmlElementVerifier.i;
                                    throw new CertificateException(var10_6[19] + (String)var2_2);
                                }
                                if (var4_5 == null) break block14;
                                var10_7 = XmlElementVerifier.i;
                                var2_2 = var10_7[33] + var4_5;
                                var5_10 = this.d.findByName(var4_5);
                                var6_11 = null;
                                var7_12 = null;
                                for (TrustedCert var9_14 : var5_10) {
                                    if (!this.a(var9_14)) {
                                        var6_11 = var9_14.getCertificate();
                                        break;
                                    }
                                    if (var7_12 != null) continue;
                                    var7_12 = var9_14.getCertificate();
                                }
                                if (var6_11 != null) ** GOTO lbl40
                                if (var7_12 == null) break block15;
                                break block18;
                                catch (FindException v1) {
                                    throw XmlElementVerifier.a((Exception)v1);
                                }
                            }
                            try {
                                block19: {
                                    if (var6_11 == null) break block16;
                                    break block19;
                                    catch (FindException v2) {
                                        throw XmlElementVerifier.a((Exception)v2);
                                    }
                                }
                                v3 = var6_11;
                                break block17;
                            }
                            catch (FindException v4) {
                                throw XmlElementVerifier.a((Exception)v4);
                            }
                        }
                        v3 = var7_12;
                    }
                    var1_1 = v3;
                    break block14;
                }
                var10_7 = XmlElementVerifier.i;
                throw new CertificateException(var10_7[24] + (String)var2_2);
            }
            catch (FindException var3_4) {
                var10_8 = XmlElementVerifier.i;
                throw new CertificateException(var10_8[2] + (String)var2_2 + var10_8[21] + ExceptionUtils.getMessage((Throwable)var3_4), var3_4);
            }
        }
        return var1_1;
    }

    private boolean a(TrustedCert trustedCert) {
        boolean bl2 = true;
        try {
            bl2 = trustedCert.isExpiredCert();
        }
        catch (CertificateException certificateException) {
            this.e.logAndAudit((AuditDetailMessage)AssertionMessages.WSSECURITY_RECIP_CERT_EXP, new String[]{trustedCert.getName() + i[39] + String.valueOf(trustedCert.getGoid()) + ")"}, (Throwable)certificateException);
        }
        return bl2;
    }

    private X509Certificate a(Element element, SecurityTokenResolver securityTokenResolver) throws CertificateException {
        try {
            String[] stringArray = i;
            Element element2 = DomUtils.findOnlyOneChildElementByName((Element)element, (String)SoapConstants.DIGSIG_URI, (String)stringArray[4]);
            try {
                if (element2 == null) {
                    throw new KeyInfoElement.UnsupportedKeyInfoFormatException(stringArray[31]);
                }
            }
            catch (KeyInfoElement.UnsupportedKeyInfoFormatException unsupportedKeyInfoFormatException) {
                throw XmlElementVerifier.a((Exception)((Object)unsupportedKeyInfoFormatException));
            }
            return XmlElementVerifier.b(element2, securityTokenResolver);
        }
        catch (KeyInfoElement.UnsupportedKeyInfoFormatException unsupportedKeyInfoFormatException) {
            String[] stringArray = new String[1];
            String[] stringArray2 = i;
            stringArray[0] = stringArray2[7] + ExceptionUtils.getMessage((Throwable)unsupportedKeyInfoFormatException);
            this.e.logAndAudit((AuditDetailMessage)AssertionMessages.EXCEPTION_INFO_WITH_MORE_INFO, stringArray, ExceptionUtils.getDebugException((Throwable)unsupportedKeyInfoFormatException));
            return null;
        }
        catch (InvalidDocumentFormatException invalidDocumentFormatException) {
            String[] stringArray = new String[1];
            String[] stringArray3 = i;
            stringArray[0] = stringArray3[38] + ExceptionUtils.getMessage((Throwable)invalidDocumentFormatException);
            this.e.logAndAudit((AuditDetailMessage)AssertionMessages.EXCEPTION_INFO_WITH_MORE_INFO, stringArray, ExceptionUtils.getDebugException((Throwable)invalidDocumentFormatException));
            return null;
        }
        catch (IOException iOException) {
            this.e.logAndAudit((AuditDetailMessage)AssertionMessages.EXCEPTION_INFO_WITH_MORE_INFO, new String[]{i[8] + ExceptionUtils.getMessage((Throwable)iOException)}, ExceptionUtils.getDebugException((Throwable)iOException));
            return null;
        }
    }

    private static X509Certificate b(Element element, SecurityTokenResolver securityTokenResolver) throws CertificateException, InvalidDocumentFormatException, IOException {
        String[] stringArray = i;
        Element element2 = DomUtils.findOnlyOneChildElementByName((Element)element, (String)SoapConstants.DIGSIG_URI, (String)stringArray[3]);
        Element element3 = DomUtils.findOnlyOneChildElementByName((Element)element, (String)SoapConstants.DIGSIG_URI, (String)stringArray[12]);
        Element element4 = DomUtils.findOnlyOneChildElementByName((Element)element, (String)SoapConstants.DIGSIG_URI, (String)stringArray[17]);
        Element element5 = DomUtils.findOnlyOneChildElementByName((Element)element, (String)SoapConstants.DIGSIG_URI, (String)stringArray[30]);
        if (element2 != null) {
            String string = DomUtils.getTextValue((Element)element2);
            byte[] byArray = CertUtils.decodeCertBytesFromPEM((String)string, (boolean)false);
            try {
                return CertUtils.decodeCert((byte[])byArray);
            }
            catch (CertificateException certificateException) {
                try {
                    if (!CERT_PARSE_BC_FALLBACK) {
                        throw certificateException;
                    }
                }
                catch (CertificateException certificateException2) {
                    throw XmlElementVerifier.a(certificateException2);
                }
                stringArray = i;
                return (X509Certificate)CertificateFactory.getInstance(stringArray[22]).generateCertificate(new ByteArrayInputStream(byArray));
            }
        }
        if (element3 != null) {
            String string = DomUtils.getTextValue((Element)element3);
            String string2 = HexUtils.encodeBase64((byte[])HexUtils.decodeBase64((String)string, (boolean)true), (boolean)true);
            return securityTokenResolver.lookupBySki(string2);
        }
        if (element4 != null) {
            stringArray = i;
            Element element6 = DomUtils.findExactlyOneChildElementByName((Element)element4, (String)SoapConstants.DIGSIG_URI, (String)stringArray[20]);
            Element element7 = DomUtils.findExactlyOneChildElementByName((Element)element4, (String)SoapConstants.DIGSIG_URI, (String)stringArray[26]);
            String string = DomUtils.getTextValue((Element)element6);
            try {
                if (string.length() == 0) {
                    throw new MissingRequiredElementException(stringArray[23]);
                }
            }
            catch (CertificateException certificateException) {
                throw XmlElementVerifier.a(certificateException);
            }
            String string3 = DomUtils.getTextValue((Element)element7);
            try {
                if (string3.length() == 0) {
                    throw new MissingRequiredElementException(i[5]);
                }
            }
            catch (CertificateException certificateException) {
                throw XmlElementVerifier.a(certificateException);
            }
            return securityTokenResolver.lookupByIssuerAndSerial(new X500Principal(string), new BigInteger(string3));
        }
        if (element5 != null) {
            String string = DomUtils.getTextValue((Element)element5);
            try {
                if (string.length() == 0) {
                    throw new MissingRequiredElementException(i[29]);
                }
            }
            catch (CertificateException certificateException) {
                throw XmlElementVerifier.a(certificateException);
            }
            return securityTokenResolver.lookupByKeyName(string);
        }
        throw new KeyInfoElement.UnsupportedKeyInfoFormatException(i[37]);
    }

    /*
     * Unable to fully structure code
     */
    static {
        block12: {
            block11: {
                var5 = new String[41];
                var3_1 = 0;
                var2_2 = "i/\u0006,N4/\u007f\u0001\u001a\bO\u0004e'Cb(I1\u0011.Yz,d&\raM35h*\r&\u000b.)y0\u0017$Oz8i1\u0017(M38m7\u0006{\u000b\u000fTvSxh?)x*\u0005(H;/i\bTvSxo;/m\u001aTvSxx?)e\"\u000f\u000f^79i1C6J){i.\u00135R\u000e_*\u0004/J..~&5 G/>\u001dY-\u0011$H5<b*\u0019$Oz\u0010i:*/M5{j,\u0011,J.a,\u0019Y-\u0002#G?{x,C1J((ic($R\u00135j,Ya-o,\u000enGm/i \u000bnX?)z&\u0011nX?8y1\n5Ru\u0003a/&-N7>b75$Y3=e&\u0011/Y-\u0002#G?{x,C$S.)m \u0017ax3<b\"\u00174Y?\u0016i7\u000b.Oz\u001a`$\f3B.3ac6\u0013b%Z&\u0011(M#{o&\u00115B<2o\"\u0017$\u000b,:~*\u0002#G?{b,\u0017aM5.b'\u0007TvSxx\u0011\u0012\n\u007f*\u0004\u0004G?6i-\u00171Z\"\u000f(Oz?\u007fy0(L4:x6\u0011$\u000b94b7\u0002(E??,-\faO)a_*\u0004/J..~&5 G/>9o,\u000eoGm/i \u000boN\"/i1\r Gt:\u007f0\u00063_34b0M9F6(i M\"N(/\\\"\u00112N\u00188J\"\u000f-I;8g\u000fz&\u0011(M#\be$\r _/)i\u0010TvSxb)(y&\u0011\u0012N(2m/WZ&\u0011(M#{o&\u00115B<2o\"\u0017$\u000b,:~*\u0002#G?{{\"\u0010aM5.b'C#^.{{\"\u0010aE5/,,\u0005a_#+ic;t\u001bc\u0018i1\u0017(M38m7\u0006aD({\\\u0006.ax.)e-\u0004#O,\u0016-Oz5c7C'B4?,7\u00114X.>hc\u0000$Y.2j*\u0000 _?{\u000eTvSxb)(y&\u0011\u000fJ7>\u00026c\u0005TmVq\u0012\u0018TvSxb)(y&\u0011\u000fJ7>,4\u00022\u000b?6|7\u001a#O,\u0016-Oz5c7C'B4?,7\u00114X.>hc\u0000$Y.2j*\u0000 _?{>M1\u00044F?5xc\u0005.Yz\u001bB,\u0017\u000f^67,3\u00023J7>x&\u0011a\f\u007f(+c\f'\u000b\u007f(\"f\u0010aF/(xc\r._z9ic\r4G6\u0010TvSxx?)e\"\u000f\u000f^79i1'Y-\u0002#G?{x,C%N.>~.\n/Nz(e$\r(E={o&\u00115B<2o\"\u0017$bI/\u0006,N4/, \f7N(>hc\u00018\u000b)2k-\u00025^(>, \u0002/E5/,!\u0006aM5.b'C(Ez4~*\u0004(E;7,'\f\"^7>b7C/D({e-C1Y58i0\u0010$Oz?c \u0016,N4/\"c6\u0013b`{\u0019TvSxx/9f&\u00005e;6ic\u0014 Xz>a3\u00178\u000fTvSxx/9f&\u00005e;6iCG&\u001a\bE<4,'\n%\u000b44xc\u0000.E.:e-C E#{~&\u0000.L42v&\u0007aH?)x*\u0005(H;/ic\u0011$M?)i-\u0000$\u000b<4~.\u00025.G&\u001a\bE<4,&\u000f$F?5xc\r._z=c6\r%\u000b35,\u0010\n&E;/y1\u0006an6>a&\r5\u0005b\"\u000e$\u000b2d7\u00171\u0011ut`\"\u001a$Ym/i \u000boH56#'\n&N)/A&\u0017)D>\u000e~*\u0010nX;,A6\u000f5B*7i\u0002h03\u007f7\u0011(E=sh0Y\u0012B=5i'*/M5th0Y\u0012B=5m7\u00163N\u0017>x+\f%\u0004\u001a\u001a`$\f3B.3aj.G&\u001a\bE<4,\u001bVq\u0012\u001e:x\"C6J){b,\u0017aB4{mc\u00104[*4~7\u0006%\u000b<4~.\u00025\u0019Y-\u0002#G?{x,C1J((ic($R\u00135j,Ya";
                var4_3 = "i/\u0006,N4/\u007f\u0001\u001a\bO\u0004e'Cb(I1\u0011.Yz,d&\raM35h*\r&\u000b.)y0\u0017$Oz8i1\u0017(M38m7\u0006{\u000b\u000fTvSxh?)x*\u0005(H;/i\bTvSxo;/m\u001aTvSxx?)e\"\u000f\u000f^79i1C6J){i.\u00135R\u000e_*\u0004/J..~&5 G/>\u001dY-\u0011$H5<b*\u0019$Oz\u0010i:*/M5{j,\u0011,J.a,\u0019Y-\u0002#G?{x,C1J((ic($R\u00135j,Ya-o,\u000enGm/i \u000bnX?)z&\u0011nX?8y1\n5Ru\u0003a/&-N7>b75$Y3=e&\u0011/Y-\u0002#G?{x,C$S.)m \u0017ax3<b\"\u00174Y?\u0016i7\u000b.Oz\u001a`$\f3B.3ac6\u0013b%Z&\u0011(M#{o&\u00115B<2o\"\u0017$\u000b,:~*\u0002#G?{b,\u0017aM5.b'\u0007TvSxx\u0011\u0012\n\u007f*\u0004\u0004G?6i-\u00171Z\"\u000f(Oz?\u007fy0(L4:x6\u0011$\u000b94b7\u0002(E??,-\faO)a_*\u0004/J..~&5 G/>9o,\u000eoGm/i \u000boN\"/i1\r Gt:\u007f0\u00063_34b0M9F6(i M\"N(/\\\"\u00112N\u00188J\"\u000f-I;8g\u000fz&\u0011(M#\be$\r _/)i\u0010TvSxb)(y&\u0011\u0012N(2m/WZ&\u0011(M#{o&\u00115B<2o\"\u0017$\u000b,:~*\u0002#G?{{\"\u0010aM5.b'C#^.{{\"\u0010aE5/,,\u0005a_#+ic;t\u001bc\u0018i1\u0017(M38m7\u0006aD({\\\u0006.ax.)e-\u0004#O,\u0016-Oz5c7C'B4?,7\u00114X.>hc\u0000$Y.2j*\u0000 _?{\u000eTvSxb)(y&\u0011\u000fJ7>\u00026c\u0005TmVq\u0012\u0018TvSxb)(y&\u0011\u000fJ7>,4\u00022\u000b?6|7\u001a#O,\u0016-Oz5c7C'B4?,7\u00114X.>hc\u0000$Y.2j*\u0000 _?{>M1\u00044F?5xc\u0005.Yz\u001bB,\u0017\u000f^67,3\u00023J7>x&\u0011a\f\u007f(+c\f'\u000b\u007f(\"f\u0010aF/(xc\r._z9ic\r4G6\u0010TvSxx?)e\"\u000f\u000f^79i1'Y-\u0002#G?{x,C%N.>~.\n/Nz(e$\r(E={o&\u00115B<2o\"\u0017$bI/\u0006,N4/, \f7N(>hc\u00018\u000b)2k-\u00025^(>, \u0002/E5/,!\u0006aM5.b'C(Ez4~*\u0004(E;7,'\f\"^7>b7C/D({e-C1Y58i0\u0010$Oz?c \u0016,N4/\"c6\u0013b`{\u0019TvSxx/9f&\u00005e;6ic\u0014 Xz>a3\u00178\u000fTvSxx/9f&\u00005e;6iCG&\u001a\bE<4,'\n%\u000b44xc\u0000.E.:e-C E#{~&\u0000.L42v&\u0007aH?)x*\u0005(H;/ic\u0011$M?)i-\u0000$\u000b<4~.\u00025.G&\u001a\bE<4,&\u000f$F?5xc\r._z=c6\r%\u000b35,\u0010\n&E;/y1\u0006an6>a&\r5\u0005b\"\u000e$\u000b2d7\u00171\u0011ut`\"\u001a$Ym/i \u000boH56#'\n&N)/A&\u0017)D>\u000e~*\u0010nX;,A6\u000f5B*7i\u0002h03\u007f7\u0011(E=sh0Y\u0012B=5i'*/M5th0Y\u0012B=5m7\u00163N\u0017>x+\f%\u0004\u001a\u001a`$\f3B.3aj.G&\u001a\bE<4,\u001bVq\u0012\u001e:x\"C6J){b,\u0017aB4{mc\u00104[*4~7\u0006%\u000b<4~.\u00025\u0019Y-\u0002#G?{x,C1J((ic($R\u00135j,Ya".length();
                var1_4 = 12;
                var0_5 = -1;
lbl7:
                // 2 sources

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

                while (true) {
                    var5[var3_1++] = XmlElementVerifier.a(v0, XmlElementVerifier.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "\u0019^u9Z\u0019;ZrX\u001a\\\u0015>Z{\u0017\u001a\\\u00048\u0015rA\u000fJ\u00053\u0006j\u0006\u0001W\u0005x\fs\u0003\u001d\\\u0015x\u0017{\u001d\u001ai\u0017$\u0007{-\r\u007f\u0017:\u0018|\u000e\rR";
                    var4_3 = "\u0019^u9Z\u0019;ZrX\u001a\\\u0015>Z{\u0017\u001a\\\u00048\u0015rA\u000fJ\u00053\u0006j\u0006\u0001W\u0005x\fs\u0003\u001d\\\u0015x\u0017{\u001d\u001ai\u0017$\u0007{-\r\u007f\u0017:\u0018|\u000e\rR".length();
                    var1_4 = 3;
                    var0_5 = -1;
lbl22:
                    // 2 sources

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

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

                ** continue;
            }
        }
        XmlElementVerifier.i = var5;
        XmlElementVerifier.a = XmlElementVerifier.i[40];
        var0_6 = XmlElementVerifier.i;
        XmlElementVerifier.CERT_PARSE_BC_FALLBACK = ConfigFactory.getBooleanProperty((String)var0_6[15], (boolean)false);
        try {
            XmlElementVerifier.h = new DOMXPath(var0_6[36]);
            XmlElementVerifier.h.addNamespace(var0_6[35], SoapUtil.DIGSIG_URI);
        }
        catch (JaxenException var6_7) {
            throw new RuntimeException(var6_7);
        }
    }

    /*
     * Exception decompiling
     */
    private static /* synthetic */ void a(int var0) {
        /*
         * This method has failed to decompile.  When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file.
         * 
         * org.benf.cfr.reader.util.ConfusedCFRException: Tried to end blocks [0[TRYBLOCK]], but top level block is 1[SWITCH]
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.processEndingBlocks(Op04StructuredStatement.java:435)
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.buildNestedBlocks(Op04StructuredStatement.java:484)
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op03SimpleStatement.createInitialStructuredBlock(Op03SimpleStatement.java:736)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:850)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:278)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:201)
         *     at org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:94)
         *     at org.benf.cfr.reader.entities.Method.analyse(Method.java:531)
         *     at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:1050)
         *     at org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:942)
         *     at org.benf.cfr.reader.Driver.doJarVersionTypes(Driver.java:257)
         *     at org.benf.cfr.reader.Driver.doJar(Driver.java:139)
         *     at org.benf.cfr.reader.CfrDriverImpl.analyse(CfrDriverImpl.java:76)
         *     at org.benf.cfr.reader.Main.main(Main.java:54)
         */
        throw new IllegalStateException("Decompilation failed");
    }

    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] ^ 0x21);
        }
        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 -> 118;
                    case 1 -> 57;
                    case 2 -> 25;
                    case 3 -> 59;
                    case 4 -> 81;
                    case 5 -> 32;
                    default -> 33;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

