package com.l7tech.server.policy.assertion.xmlsec;

import com.l7tech.common.io.CertUtils;
import com.l7tech.gateway.common.audit.AssertionMessages;
import com.l7tech.message.Message;
import com.l7tech.policy.assertion.AssertionStatus;
import com.l7tech.policy.assertion.PolicyAssertionException;
import com.l7tech.policy.assertion.xmlsec.SecurityHeaderAddressableSupport;
import com.l7tech.policy.assertion.xmlsec.WssReplayProtection;
import com.l7tech.policy.variable.Syntax;
import com.l7tech.security.token.SignedElement;
import com.l7tech.security.xml.SecurityTokenResolver;
import com.l7tech.server.extension.provider.sharedstate.SharedStateProviderLowMemoryException;
import com.l7tech.server.message.AuthenticationContext;
import com.l7tech.server.message.PolicyEnforcementContext;
import com.l7tech.server.policy.assertion.AbstractMessageTargetableServerAssertion;
import com.l7tech.server.policy.assertion.AssertionStatusException;
import com.l7tech.server.policy.variable.ExpandVariables;
import com.l7tech.server.util.MessageId;
import com.l7tech.server.util.MessageIdManager;
import com.l7tech.util.Charsets;
import com.l7tech.util.Config;
import com.l7tech.util.ConfigFactory;
import com.l7tech.util.ExceptionUtils;
import com.l7tech.util.HexUtils;
import com.l7tech.util.Pair;
import com.l7tech.util.TimeSource;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import java.security.cert.CertificateEncodingException;
import java.security.cert.X509Certificate;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.springframework.beans.factory.BeanFactory;
import org.w3c.dom.Element;

public class ServerWssReplayProtection extends AbstractMessageTargetableServerAssertion<WssReplayProtection> {
   private static final long d = 60000L;
   private static final long e = 2592000000L;
   private static final long f = 300000L;
   private static final long g = 600000L;
   private static final String h;
   private static final int i;
   private static final int j;
   private static final String k;
   private static final Charset l;
   private final MessageIdManager m;
   private final Config n;
   private final SecurityTokenResolver o;
   private final TimeSource p;
   private static final Logger q;
   private static final String[] s;

   public ServerWssReplayProtection(WssReplayProtection var1, BeanFactory var2) {
      super(var1);
      String[] var3 = s;
      this.m = (MessageIdManager)var2.getBean(var3[11], MessageIdManager.class);
      this.n = (Config)var2.getBean(var3[2], Config.class);
      this.o = (SecurityTokenResolver)var2.getBean(var3[12], SecurityTokenResolver.class);
      this.p = this.getTimeSource();
   }

   @Override
   public AssertionStatus checkRequest(PolicyEnforcementContext var1) throws IOException, PolicyAssertionException {
      try {
         if (!SecurityHeaderAddressableSupport.isLocalRecipient(this.assertion)) {
            this.logAndAudit(AssertionMessages.REQUESTWSS_NOT_FOR_US);
            return AssertionStatus.NONE;
         }
      } catch (IOException var2) {
         throw a(var2);
      }

      return super.checkRequest(var1);
   }

   @Override
   protected AssertionStatus doCheckRequest(PolicyEnforcementContext var1, Message var2, String var3, AuthenticationContext var4) throws IOException {
      Pair var5;
      try {
         if (this.assertion.isCustomProtection()) {
            var5 = this.a(var1, var3);
         } else {
            var5 = this.a(var1, var2, var3, var4);
         }
      } catch (AssertionStatusException var8) {
         return var8.getAssertionStatus();
      }

      MessageId var6 = new MessageId((String)var5.left, (Long)var5.right);

      try {
         this.m.assertMessageIdIsUnique(var6);
         this.logAndAudit(AssertionMessages.REQUEST_WSS_REPLAY_PROTECTION_SUCCEEDED, (String)var5.left, var3);
      } catch (MessageIdManager.DuplicateMessageIdException var10) {
         this.logAndAudit(AssertionMessages.REQUEST_WSS_REPLAY_REPLAY, (String)var5.left, var3);
         return this.getBadMessageStatus();
      } catch (MessageIdManager.MessageIdCheckException var11) {
         MessageIdManager.MessageIdCheckException var7 = var11;

         try {
            if (var7.getCause() instanceof SharedStateProviderLowMemoryException) {
               q.log(Level.WARNING, s[1] + ExceptionUtils.getMessage(var7));
               var1.setVariable(WssReplayProtection.VARIABLE_REASON_CODE, AssertionStatus.INSUFFICIENT_STORAGE.getNumeric());
               return AssertionStatus.FAILED;
            }
         } catch (AssertionStatusException var9) {
            throw a(var9);
         }

         this.logAndAudit(AssertionMessages.EXCEPTION_WARNING_WITH_MORE_INFO, new String[]{s[3] + ExceptionUtils.getMessage(var11)}, var11);
         return AssertionStatus.FAILED;
      }

      return AssertionStatus.NONE;
   }

   protected TimeSource getTimeSource() {
      return new TimeSource();
   }

   private Pair<String, Long> a(PolicyEnforcementContext param1, Message param2, String param3, AuthenticationContext param4) throws IOException {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 000: aload 0
      // 001: getfield com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.p Lcom/l7tech/util/TimeSource;
      // 004: invokevirtual com/l7tech/util/TimeSource.currentTimeMillis ()J
      // 007: lstore 5
      // 009: aload 2
      // 00a: invokevirtual com/l7tech/message/Message.isSoap ()Z
      // 00d: ifne 02e
      // 010: aload 0
      // 011: getstatic com/l7tech/gateway/common/audit/MessageProcessingMessages.MESSAGE_VAR_NOT_SOAP Lcom/l7tech/gateway/common/audit/Messages$M;
      // 014: bipush 1
      // 015: anewarray 336
      // 018: dup
      // 019: bipush 0
      // 01a: aload 3
      // 01b: aastore
      // 01c: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.logAndAudit (Lcom/l7tech/gateway/common/audit/AuditDetailMessage;[Ljava/lang/String;)V
      // 01f: new com/l7tech/server/policy/assertion/AssertionStatusException
      // 022: dup
      // 023: getstatic com/l7tech/policy/assertion/AssertionStatus.NOT_APPLICABLE Lcom/l7tech/policy/assertion/AssertionStatus;
      // 026: invokespecial com/l7tech/server/policy/assertion/AssertionStatusException.<init> (Lcom/l7tech/policy/assertion/AssertionStatus;)V
      // 029: athrow
      // 02a: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 02d: athrow
      // 02e: bipush 1
      // 02f: newarray 4
      // 031: dup
      // 032: bipush 0
      // 033: bipush 0
      // 034: bastore
      // 035: astore 11
      // 037: aload 0
      // 038: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.isRequest ()Z
      // 03b: ifeq 066
      // 03e: aload 0
      // 03f: getfield com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.n Lcom/l7tech/util/Config;
      // 042: getstatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.s [Ljava/lang/String;
      // 045: bipush 10
      // 047: aaload
      // 048: bipush 1
      // 049: invokeinterface com/l7tech/util/Config.getBooleanProperty (Ljava/lang/String;Z)Z 3
      // 04e: ifne 066
      // 051: goto 058
      // 054: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 057: athrow
      // 058: aload 2
      // 059: invokevirtual com/l7tech/message/Message.getSecurityKnob ()Lcom/l7tech/message/SecurityKnob;
      // 05c: invokeinterface com/l7tech/message/SecurityKnob.getProcessorResult ()Lcom/l7tech/security/xml/processor/ProcessorResult; 1
      // 061: astore 10
      // 063: goto 084
      // 066: new com/l7tech/server/policy/assertion/xmlsec/w
      // 069: dup
      // 06a: aload 0
      // 06b: aload 11
      // 06d: invokespecial com/l7tech/server/policy/assertion/xmlsec/w.<init> (Lcom/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection;[Z)V
      // 070: astore 12
      // 072: aload 2
      // 073: aload 3
      // 074: aload 0
      // 075: getfield com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.o Lcom/l7tech/security/xml/SecurityTokenResolver;
      // 078: aconst_null
      // 079: aload 0
      // 07a: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.getAudit ()Lcom/l7tech/gateway/common/audit/Audit;
      // 07d: aload 12
      // 07f: invokestatic com/l7tech/server/util/WSSecurityProcessorUtils.getWssResults (Lcom/l7tech/message/Message;Ljava/lang/String;Lcom/l7tech/security/xml/SecurityTokenResolver;Lcom/l7tech/security/xml/processor/SecurityContextFinder;Lcom/l7tech/gateway/common/audit/Audit;Lcom/l7tech/util/Functions$Unary;)Lcom/l7tech/security/xml/processor/ProcessorResult;
      // 082: astore 10
      // 084: aload 10
      // 086: ifnonnull 0db
      // 089: aload 0
      // 08a: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.isRequest ()Z
      // 08d: ifeq 0aa
      // 090: goto 097
      // 093: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 096: athrow
      // 097: aload 1
      // 098: invokeinterface com/l7tech/server/message/PolicyEnforcementContext.setRequestPolicyViolated ()V 1
      // 09d: aload 1
      // 09e: invokeinterface com/l7tech/server/message/PolicyEnforcementContext.setAuthenticationMissing ()V 1
      // 0a3: goto 0aa
      // 0a6: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 0a9: athrow
      // 0aa: aload 11
      // 0ac: bipush 0
      // 0ad: baload
      // 0ae: ifeq 0c1
      // 0b1: new com/l7tech/server/policy/assertion/AssertionStatusException
      // 0b4: dup
      // 0b5: aload 0
      // 0b6: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.getBadMessageStatus ()Lcom/l7tech/policy/assertion/AssertionStatus;
      // 0b9: invokespecial com/l7tech/server/policy/assertion/AssertionStatusException.<init> (Lcom/l7tech/policy/assertion/AssertionStatus;)V
      // 0bc: athrow
      // 0bd: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 0c0: athrow
      // 0c1: aload 0
      // 0c2: getstatic com/l7tech/gateway/common/audit/AssertionMessages.REQUEST_WSS_REPLAY_NO_WSS_LEVEL_SECURITY Lcom/l7tech/gateway/common/audit/Messages$M;
      // 0c5: bipush 1
      // 0c6: anewarray 336
      // 0c9: dup
      // 0ca: bipush 0
      // 0cb: aload 3
      // 0cc: aastore
      // 0cd: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.logAndAudit (Lcom/l7tech/gateway/common/audit/AuditDetailMessage;[Ljava/lang/String;)V
      // 0d0: new com/l7tech/server/policy/assertion/AssertionStatusException
      // 0d3: dup
      // 0d4: getstatic com/l7tech/policy/assertion/AssertionStatus.NOT_APPLICABLE Lcom/l7tech/policy/assertion/AssertionStatus;
      // 0d7: invokespecial com/l7tech/server/policy/assertion/AssertionStatusException.<init> (Lcom/l7tech/policy/assertion/AssertionStatus;)V
      // 0da: athrow
      // 0db: goto 0ef
      // 0de: astore 11
      // 0e0: new java/io/IOException
      // 0e3: dup
      // 0e4: aload 11
      // 0e6: invokestatic com/l7tech/util/ExceptionUtils.getMessage (Ljava/lang/Throwable;)Ljava/lang/String;
      // 0e9: aload 11
      // 0eb: invokespecial java/io/IOException.<init> (Ljava/lang/String;Ljava/lang/Throwable;)V
      // 0ee: athrow
      // 0ef: aconst_null
      // 0f0: astore 11
      // 0f2: aload 2
      // 0f3: getstatic com/l7tech/message/MessageRole.REQUEST Lcom/l7tech/message/MessageRole;
      // 0f6: invokevirtual com/l7tech/message/Message.getRelated (Lcom/l7tech/message/MessageRole;)Lcom/l7tech/message/Message;
      // 0f9: astore 12
      // 0fb: aload 4
      // 0fd: aload 10
      // 0ff: aload 0
      // 100: getfield com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.assertion Lcom/l7tech/policy/assertion/Assertion;
      // 103: checkcast com/l7tech/policy/assertion/xmlsec/WssReplayProtection
      // 106: invokevirtual com/l7tech/policy/assertion/xmlsec/WssReplayProtection.getIdentityTarget ()Lcom/l7tech/policy/assertion/IdentityTarget;
      // 109: bipush 0
      // 10a: aload 12
      // 10c: aload 12
      // 10e: ifnonnull 119
      // 111: aconst_null
      // 112: goto 121
      // 115: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 118: athrow
      // 119: aload 1
      // 11a: aload 12
      // 11c: invokeinterface com/l7tech/server/message/PolicyEnforcementContext.getAuthenticationContext (Lcom/l7tech/message/Message;)Lcom/l7tech/server/message/AuthenticationContext; 2
      // 121: aload 0
      // 122: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.getAudit ()Lcom/l7tech/gateway/common/audit/Audit;
      // 125: invokestatic com/l7tech/server/util/WSSecurityProcessorUtils.filterSignedElementsByIdentity (Lcom/l7tech/server/message/AuthenticationContext;Lcom/l7tech/security/xml/processor/ProcessorResult;Lcom/l7tech/policy/assertion/IdentityTarget;ZLcom/l7tech/message/Message;Lcom/l7tech/server/message/AuthenticationContext;Lcom/l7tech/gateway/common/audit/Audit;)[Lcom/l7tech/security/token/SignedElement;
      // 128: astore 13
      // 12a: aload 13
      // 12c: astore 14
      // 12e: aload 14
      // 130: arraylength
      // 131: istore 15
      // 133: bipush 0
      // 134: istore 16
      // 136: iload 16
      // 138: iload 15
      // 13a: if_icmpge 1bb
      // 13d: aload 14
      // 13f: iload 16
      // 141: aaload
      // 142: astore 17
      // 144: aload 17
      // 146: invokeinterface com/l7tech/security/token/SignedElement.asElement ()Lorg/w3c/dom/Element; 1
      // 14b: astore 18
      // 14d: aload 18
      // 14f: getstatic com/l7tech/util/SoapConstants.WSA_NAMESPACE_ARRAY [Ljava/lang/String;
      // 152: invokestatic com/l7tech/util/DomUtils.elementInNamespace (Lorg/w3c/dom/Element;[Ljava/lang/String;)Z
      // 155: ifeq 1b5
      // 158: getstatic com/l7tech/util/SoapConstants.MESSAGEID_EL_NAME Ljava/lang/String;
      // 15b: aload 18
      // 15d: invokeinterface org/w3c/dom/Element.getLocalName ()Ljava/lang/String; 1
      // 162: invokevirtual java/lang/String.equals (Ljava/lang/Object;)Z
      // 165: ifeq 1b5
      // 168: goto 16f
      // 16b: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 16e: athrow
      // 16f: aload 11
      // 171: ifnull 19a
      // 174: goto 17b
      // 177: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 17a: athrow
      // 17b: aload 0
      // 17c: getstatic com/l7tech/gateway/common/audit/AssertionMessages.REQUEST_WSS_REPLAY_MULTIPLE_MESSAGE_IDS Lcom/l7tech/gateway/common/audit/Messages$M;
      // 17f: bipush 1
      // 180: anewarray 336
      // 183: dup
      // 184: bipush 0
      // 185: aload 3
      // 186: aastore
      // 187: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.logAndAudit (Lcom/l7tech/gateway/common/audit/AuditDetailMessage;[Ljava/lang/String;)V
      // 18a: new com/l7tech/server/policy/assertion/AssertionStatusException
      // 18d: dup
      // 18e: aload 0
      // 18f: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.getBadMessageStatus ()Lcom/l7tech/policy/assertion/AssertionStatus;
      // 192: invokespecial com/l7tech/server/policy/assertion/AssertionStatusException.<init> (Lcom/l7tech/policy/assertion/AssertionStatus;)V
      // 195: athrow
      // 196: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 199: athrow
      // 19a: aload 18
      // 19c: invokestatic com/l7tech/util/DomUtils.getTextValue (Lorg/w3c/dom/Element;)Ljava/lang/String;
      // 19f: astore 11
      // 1a1: aload 0
      // 1a2: getstatic com/l7tech/gateway/common/audit/AssertionMessages.REQUEST_WSS_REPLAY_GOT_SIGNED_MESSAGE_ID Lcom/l7tech/gateway/common/audit/Messages$M;
      // 1a5: bipush 2
      // 1a6: anewarray 336
      // 1a9: dup
      // 1aa: bipush 0
      // 1ab: aload 3
      // 1ac: aastore
      // 1ad: dup
      // 1ae: bipush 1
      // 1af: aload 11
      // 1b1: aastore
      // 1b2: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.logAndAudit (Lcom/l7tech/gateway/common/audit/AuditDetailMessage;[Ljava/lang/String;)V
      // 1b5: iinc 16 1
      // 1b8: goto 136
      // 1bb: aload 11
      // 1bd: ifnonnull 1d6
      // 1c0: aload 0
      // 1c1: getstatic com/l7tech/gateway/common/audit/AssertionMessages.REQUEST_WSS_REPLAY_NO_SIGNED_MESSAGE_ID Lcom/l7tech/gateway/common/audit/Messages$M;
      // 1c4: bipush 1
      // 1c5: anewarray 336
      // 1c8: dup
      // 1c9: bipush 0
      // 1ca: aload 3
      // 1cb: aastore
      // 1cc: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.logAndAudit (Lcom/l7tech/gateway/common/audit/AuditDetailMessage;[Ljava/lang/String;)V
      // 1cf: goto 1d6
      // 1d2: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 1d5: athrow
      // 1d6: aload 10
      // 1d8: invokeinterface com/l7tech/security/xml/processor/ProcessorResult.getTimestamp ()Lcom/l7tech/security/xml/processor/WssTimestamp; 1
      // 1dd: astore 14
      // 1df: aload 14
      // 1e1: ifnonnull 21a
      // 1e4: aload 0
      // 1e5: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.isRequest ()Z
      // 1e8: ifeq 1ff
      // 1eb: goto 1f2
      // 1ee: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 1f1: athrow
      // 1f2: aload 1
      // 1f3: invokeinterface com/l7tech/server/message/PolicyEnforcementContext.setRequestPolicyViolated ()V 1
      // 1f8: goto 1ff
      // 1fb: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 1fe: athrow
      // 1ff: aload 0
      // 200: getstatic com/l7tech/gateway/common/audit/AssertionMessages.REQUEST_WSS_REPLAY_NO_TIMESTAMP Lcom/l7tech/gateway/common/audit/Messages$M;
      // 203: bipush 1
      // 204: anewarray 336
      // 207: dup
      // 208: bipush 0
      // 209: aload 3
      // 20a: aastore
      // 20b: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.logAndAudit (Lcom/l7tech/gateway/common/audit/AuditDetailMessage;[Ljava/lang/String;)V
      // 20e: new com/l7tech/server/policy/assertion/AssertionStatusException
      // 211: dup
      // 212: aload 0
      // 213: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.getBadMessageStatus ()Lcom/l7tech/policy/assertion/AssertionStatus;
      // 216: invokespecial com/l7tech/server/policy/assertion/AssertionStatusException.<init> (Lcom/l7tech/policy/assertion/AssertionStatus;)V
      // 219: athrow
      // 21a: aload 14
      // 21c: invokeinterface com/l7tech/security/xml/processor/WssTimestamp.asElement ()Lorg/w3c/dom/Element; 1
      // 221: aload 13
      // 223: invokestatic com/l7tech/security/xml/processor/ProcessorResultUtil.getParsedElementsForNode (Lorg/w3c/dom/Node;[Lcom/l7tech/security/token/ParsedElement;)Ljava/util/Collection;
      // 226: invokeinterface java/util/Collection.isEmpty ()Z 1
      // 22b: ifeq 24d
      // 22e: aload 0
      // 22f: getstatic com/l7tech/gateway/common/audit/AssertionMessages.REQUEST_WSS_REPLAY_TIMESTAMP_NOT_SIGNED Lcom/l7tech/gateway/common/audit/Messages$M;
      // 232: bipush 1
      // 233: anewarray 336
      // 236: dup
      // 237: bipush 0
      // 238: aload 3
      // 239: aastore
      // 23a: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.logAndAudit (Lcom/l7tech/gateway/common/audit/AuditDetailMessage;[Ljava/lang/String;)V
      // 23d: new com/l7tech/server/policy/assertion/AssertionStatusException
      // 240: dup
      // 241: aload 0
      // 242: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.getBadMessageStatus ()Lcom/l7tech/policy/assertion/AssertionStatus;
      // 245: invokespecial com/l7tech/server/policy/assertion/AssertionStatusException.<init> (Lcom/l7tech/policy/assertion/AssertionStatus;)V
      // 248: athrow
      // 249: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 24c: athrow
      // 24d: aload 14
      // 24f: invokeinterface com/l7tech/security/xml/processor/WssTimestamp.getCreated ()Lcom/l7tech/security/xml/processor/WssTimestampDate; 1
      // 254: astore 15
      // 256: aload 15
      // 258: ifnonnull 27a
      // 25b: aload 0
      // 25c: getstatic com/l7tech/gateway/common/audit/AssertionMessages.REQUEST_WSS_REPLAY_TIMESTAMP_NO_CREATED_ELEMENT Lcom/l7tech/gateway/common/audit/Messages$M;
      // 25f: bipush 1
      // 260: anewarray 336
      // 263: dup
      // 264: bipush 0
      // 265: aload 3
      // 266: aastore
      // 267: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.logAndAudit (Lcom/l7tech/gateway/common/audit/AuditDetailMessage;[Ljava/lang/String;)V
      // 26a: new com/l7tech/server/policy/assertion/AssertionStatusException
      // 26d: dup
      // 26e: aload 0
      // 26f: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.getBadMessageStatus ()Lcom/l7tech/policy/assertion/AssertionStatus;
      // 272: invokespecial com/l7tech/server/policy/assertion/AssertionStatusException.<init> (Lcom/l7tech/policy/assertion/AssertionStatus;)V
      // 275: athrow
      // 276: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 279: athrow
      // 27a: aload 15
      // 27c: invokeinterface com/l7tech/security/xml/processor/WssTimestampDate.asIsoString ()Ljava/lang/String; 1
      // 281: invokevirtual java/lang/String.trim ()Ljava/lang/String;
      // 284: astore 16
      // 286: aload 15
      // 288: invokeinterface com/l7tech/security/xml/processor/WssTimestampDate.asTime ()J 1
      // 28d: lstore 17
      // 28f: aload 14
      // 291: invokeinterface com/l7tech/security/xml/processor/WssTimestamp.getExpires ()Lcom/l7tech/security/xml/processor/WssTimestampDate; 1
      // 296: ifnull 2aa
      // 299: aload 14
      // 29b: invokeinterface com/l7tech/security/xml/processor/WssTimestamp.getExpires ()Lcom/l7tech/security/xml/processor/WssTimestampDate; 1
      // 2a0: invokeinterface com/l7tech/security/xml/processor/WssTimestampDate.asTime ()J 1
      // 2a5: lstore 8
      // 2a7: goto 2ca
      // 2aa: aload 0
      // 2ab: getstatic com/l7tech/gateway/common/audit/AssertionMessages.REQUEST_WSS_REPLAY_TIMESTAMP_NO_EXPIRES_ELEMENT Lcom/l7tech/gateway/common/audit/Messages$M;
      // 2ae: bipush 2
      // 2af: anewarray 336
      // 2b2: dup
      // 2b3: bipush 0
      // 2b4: aload 3
      // 2b5: aastore
      // 2b6: dup
      // 2b7: bipush 1
      // 2b8: ldc2_w 600000
      // 2bb: invokestatic java/lang/String.valueOf (J)Ljava/lang/String;
      // 2be: aastore
      // 2bf: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.logAndAudit (Lcom/l7tech/gateway/common/audit/AuditDetailMessage;[Ljava/lang/String;)V
      // 2c2: lload 17
      // 2c4: ldc2_w 600000
      // 2c7: ladd
      // 2c8: lstore 8
      // 2ca: lload 8
      // 2cc: lload 5
      // 2ce: ldc2_w 60000
      // 2d1: lsub
      // 2d2: lcmp
      // 2d3: ifgt 2f5
      // 2d6: aload 0
      // 2d7: getstatic com/l7tech/gateway/common/audit/AssertionMessages.REQUEST_WSS_REPLAY_STALE_TIMESTAMP Lcom/l7tech/gateway/common/audit/Messages$M;
      // 2da: bipush 1
      // 2db: anewarray 336
      // 2de: dup
      // 2df: bipush 0
      // 2e0: aload 3
      // 2e1: aastore
      // 2e2: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.logAndAudit (Lcom/l7tech/gateway/common/audit/AuditDetailMessage;[Ljava/lang/String;)V
      // 2e5: new com/l7tech/server/policy/assertion/AssertionStatusException
      // 2e8: dup
      // 2e9: aload 0
      // 2ea: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.getBadMessageStatus ()Lcom/l7tech/policy/assertion/AssertionStatus;
      // 2ed: invokespecial com/l7tech/server/policy/assertion/AssertionStatusException.<init> (Lcom/l7tech/policy/assertion/AssertionStatus;)V
      // 2f0: athrow
      // 2f1: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 2f4: athrow
      // 2f5: lload 17
      // 2f7: lload 5
      // 2f9: lcmp
      // 2fa: ifle 31b
      // 2fd: aload 0
      // 2fe: getstatic com/l7tech/gateway/common/audit/AssertionMessages.REQUEST_WSS_REPLAY_CLOCK_SKEW Lcom/l7tech/gateway/common/audit/Messages$M;
      // 301: bipush 2
      // 302: anewarray 336
      // 305: dup
      // 306: bipush 0
      // 307: aload 3
      // 308: aastore
      // 309: dup
      // 30a: bipush 1
      // 30b: lload 17
      // 30d: invokestatic java/lang/String.valueOf (J)Ljava/lang/String;
      // 310: aastore
      // 311: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.logAndAudit (Lcom/l7tech/gateway/common/audit/AuditDetailMessage;[Ljava/lang/String;)V
      // 314: goto 31b
      // 317: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 31a: athrow
      // 31b: lload 17
      // 31d: lload 5
      // 31f: ldc2_w 2592000000
      // 322: lsub
      // 323: lcmp
      // 324: ifgt 346
      // 327: aload 0
      // 328: getstatic com/l7tech/gateway/common/audit/AssertionMessages.REQUEST_WSS_REPLAY_CREATED_TOO_OLD Lcom/l7tech/gateway/common/audit/Messages$M;
      // 32b: bipush 1
      // 32c: anewarray 336
      // 32f: dup
      // 330: bipush 0
      // 331: aload 3
      // 332: aastore
      // 333: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.logAndAudit (Lcom/l7tech/gateway/common/audit/AuditDetailMessage;[Ljava/lang/String;)V
      // 336: new com/l7tech/server/policy/assertion/AssertionStatusException
      // 339: dup
      // 33a: aload 0
      // 33b: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.getBadMessageStatus ()Lcom/l7tech/policy/assertion/AssertionStatus;
      // 33e: invokespecial com/l7tech/server/policy/assertion/AssertionStatusException.<init> (Lcom/l7tech/policy/assertion/AssertionStatus;)V
      // 341: athrow
      // 342: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 345: athrow
      // 346: aload 11
      // 348: ifnull 3b0
      // 34b: aload 11
      // 34d: invokevirtual java/lang/String.length ()I
      // 350: getstatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.j I
      // 353: if_icmple 383
      // 356: goto 35d
      // 359: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 35c: athrow
      // 35d: aload 0
      // 35e: getstatic com/l7tech/gateway/common/audit/AssertionMessages.REQUEST_WSS_REPLAY_MESSAGE_ID_TOO_LARGE Lcom/l7tech/gateway/common/audit/Messages$M;
      // 361: bipush 1
      // 362: anewarray 336
      // 365: dup
      // 366: bipush 0
      // 367: aload 11
      // 369: invokevirtual java/lang/String.length ()I
      // 36c: invokestatic java/lang/Integer.toString (I)Ljava/lang/String;
      // 36f: aastore
      // 370: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.logAndAudit (Lcom/l7tech/gateway/common/audit/AuditDetailMessage;[Ljava/lang/String;)V
      // 373: new com/l7tech/server/policy/assertion/AssertionStatusException
      // 376: dup
      // 377: aload 0
      // 378: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.getBadMessageStatus ()Lcom/l7tech/policy/assertion/AssertionStatus;
      // 37b: invokespecial com/l7tech/server/policy/assertion/AssertionStatusException.<init> (Lcom/l7tech/policy/assertion/AssertionStatus;)V
      // 37e: athrow
      // 37f: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 382: athrow
      // 383: aload 11
      // 385: invokevirtual java/lang/String.length ()I
      // 388: getstatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.i I
      // 38b: if_icmple 3a5
      // 38e: aload 0
      // 38f: aload 11
      // 391: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Ljava/lang/String;)Ljava/lang/String;
      // 394: getstatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.s [Ljava/lang/String;
      // 397: bipush 9
      // 399: aaload
      // 39a: swap
      // 39b: invokedynamic makeConcatWithConstants (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; bsm=java/lang/invoke/StringConcatFactory.makeConcatWithConstants (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite; args=[ "\u0001\u0001" ]
      // 3a0: astore 7
      // 3a2: goto 3fb
      // 3a5: aload 0
      // 3a6: aload 11
      // 3a8: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.c (Ljava/lang/String;)Ljava/lang/String;
      // 3ab: astore 7
      // 3ad: goto 3fb
      // 3b0: aload 0
      // 3b1: aload 14
      // 3b3: invokeinterface com/l7tech/security/xml/processor/WssTimestamp.asElement ()Lorg/w3c/dom/Element; 1
      // 3b8: aload 13
      // 3ba: aload 16
      // 3bc: aload 3
      // 3bd: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Lorg/w3c/dom/Element;[Lcom/l7tech/security/token/SignedElement;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
      // 3c0: astore 19
      // 3c2: aload 19
      // 3c4: ifnonnull 3d7
      // 3c7: new com/l7tech/server/policy/assertion/AssertionStatusException
      // 3ca: dup
      // 3cb: aload 0
      // 3cc: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.getBadMessageStatus ()Lcom/l7tech/policy/assertion/AssertionStatus;
      // 3cf: invokespecial com/l7tech/server/policy/assertion/AssertionStatusException.<init> (Lcom/l7tech/policy/assertion/AssertionStatus;)V
      // 3d2: athrow
      // 3d3: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 3d6: athrow
      // 3d7: aload 19
      // 3d9: astore 7
      // 3db: goto 3fb
      // 3de: astore 19
      // 3e0: aload 0
      // 3e1: getstatic com/l7tech/gateway/common/audit/AssertionMessages.REQUEST_WSS_REPLAY_MULTIPLE_SENDER_IDS Lcom/l7tech/gateway/common/audit/Messages$M;
      // 3e4: bipush 1
      // 3e5: anewarray 336
      // 3e8: dup
      // 3e9: bipush 0
      // 3ea: aload 3
      // 3eb: aastore
      // 3ec: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.logAndAudit (Lcom/l7tech/gateway/common/audit/AuditDetailMessage;[Ljava/lang/String;)V
      // 3ef: new com/l7tech/server/policy/assertion/AssertionStatusException
      // 3f2: dup
      // 3f3: aload 0
      // 3f4: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.getBadMessageStatus ()Lcom/l7tech/policy/assertion/AssertionStatus;
      // 3f7: invokespecial com/l7tech/server/policy/assertion/AssertionStatusException.<init> (Lcom/l7tech/policy/assertion/AssertionStatus;)V
      // 3fa: athrow
      // 3fb: new com/l7tech/util/Pair
      // 3fe: dup
      // 3ff: aload 7
      // 401: lload 8
      // 403: ldc2_w 300000
      // 406: ladd
      // 407: invokestatic java/lang/Long.valueOf (J)Ljava/lang/Long;
      // 40a: invokespecial com/l7tech/util/Pair.<init> (Ljava/lang/Object;Ljava/lang/Object;)V
      // 40d: areturn
      // try (80 -> 90): 90 org/xml/sax/SAXException
      // try (67 -> 77): 78 org/xml/sax/SAXException
      // try (65 -> 70): 71 org/xml/sax/SAXException
      // try (30 -> 41): 42 org/xml/sax/SAXException
      // try (4 -> 21): 21 org/xml/sax/SAXException
      // try (4 -> 106): 107 org/xml/sax/SAXException
      // try (456 -> 464): 464 org/xml/sax/SAXException
      // try (403 -> 427): 427 org/xml/sax/SAXException
      // try (401 -> 407): 408 org/xml/sax/SAXException
      // try (378 -> 399): 399 org/xml/sax/SAXException
      // try (357 -> 375): 376 org/xml/sax/SAXException
      // try (334 -> 355): 355 org/xml/sax/SAXException
      // try (282 -> 299): 299 org/xml/sax/SAXException
      // try (256 -> 277): 277 org/xml/sax/SAXException
      // try (230 -> 238): 239 org/xml/sax/SAXException
      // try (228 -> 233): 234 org/xml/sax/SAXException
      // try (211 -> 222): 223 org/xml/sax/SAXException
      // try (171 -> 191): 191 org/xml/sax/SAXException
      // try (163 -> 173): 174 org/xml/sax/SAXException
      // try (159 -> 168): 169 org/xml/sax/SAXException
      // try (121 -> 133): 133 org/xml/sax/SAXException
      // try (448 -> 468): 469 com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection$MultipleSenderIdException
   }

   private Pair<String, Long> a(PolicyEnforcementContext var1, String var2) {
      long var3 = this.p.currentTimeMillis();

      String var5;
      long var6;
      try {
         String var8 = this.assertion.getCustomIdentifierVariable();
         ArrayList var9 = new ArrayList();

         try {
            if (var8 != null) {
               var9.add(var8);
            }
         } catch (IllegalArgumentException var13) {
            throw a(var13);
         }

         try {
            if (this.assertion.getCustomScope() != null) {
               var9.addAll(Arrays.asList(Syntax.getReferencedNames(this.assertion.getCustomScope())));
            }
         } catch (IllegalArgumentException var14) {
            throw a(var14);
         }

         Map var10 = var1.getVariableMap(var9.toArray(new String[var9.size()]), this.getAudit());

         String var10000;
         label48: {
            try {
               if (this.assertion.getCustomScope() == null) {
                  var10000 = "";
                  break label48;
               }
            } catch (IllegalArgumentException var15) {
               throw a(var15);
            }

            var10000 = ExpandVariables.process(this.assertion.getCustomScope(), var10, this.getAudit(), true);
         }

         String var11 = var10000;
         String var12 = ExpandVariables.process(Syntax.SYNTAX_PREFIX + var8 + "}", var10, this.getAudit(), true);

         try {
            if (var12.isEmpty()) {
               this.logAndAudit(AssertionMessages.REQUEST_WSS_REPLAY_CUSTOM_VAR_EMPTY, var2);
               throw new AssertionStatusException(AssertionStatus.FALSIFIED);
            }
         } catch (IllegalArgumentException var16) {
            throw a(var16);
         }

         this.logAndAudit(AssertionMessages.REQUEST_WSS_REPLAY_USING_SCOPE_AND_ID, var2, var11, var12);
         var5 = MessageFormat.format(s[0], this.a(var11), this.a(var12));
         var6 = var3 + this.assertion.getCustomExpiryTime();
      } catch (IllegalArgumentException var17) {
         this.logAndAudit(
            AssertionMessages.REQUEST_WSS_REPLAY_CUSTOM_VAR_ERROR,
            new String[]{var2, ExceptionUtils.getMessage(var17)},
            ExceptionUtils.getDebugException(var17)
         );
         throw new AssertionStatusException(AssertionStatus.FAILED);
      }

      return new Pair(var5, var6);
   }

   private String a(Element param1, SignedElement[] param2, String param3, String param4) throws ServerWssReplayProtection.MultipleSenderIdException, UnsupportedEncodingException {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 000: aconst_null
      // 001: astore 5
      // 003: aload 2
      // 004: astore 6
      // 006: aload 6
      // 008: arraylength
      // 009: istore 7
      // 00b: bipush 0
      // 00c: istore 8
      // 00e: iload 8
      // 010: iload 7
      // 012: if_icmpge 280
      // 015: aload 6
      // 017: iload 8
      // 019: aaload
      // 01a: astore 9
      // 01c: aload 1
      // 01d: aload 9
      // 01f: invokeinterface com/l7tech/security/token/SignedElement.asElement ()Lorg/w3c/dom/Element; 1
      // 024: invokeinterface org/w3c/dom/Element.isSameNode (Lorg/w3c/dom/Node;)Z 2
      // 029: ifne 033
      // 02c: goto 27a
      // 02f: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 032: athrow
      // 033: aload 9
      // 035: invokeinterface com/l7tech/security/token/SignedElement.getSigningSecurityToken ()Lcom/l7tech/security/token/SigningSecurityToken; 1
      // 03a: astore 10
      // 03c: aload 10
      // 03e: instanceof com/l7tech/security/token/X509SigningSecurityToken
      // 041: ifeq 0ee
      // 044: aload 5
      // 046: ifnull 05c
      // 049: goto 050
      // 04c: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 04f: athrow
      // 050: new com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection$MultipleSenderIdException
      // 053: dup
      // 054: invokespecial com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection$MultipleSenderIdException.<init> ()V
      // 057: athrow
      // 058: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 05b: athrow
      // 05c: aload 10
      // 05e: checkcast com/l7tech/security/token/X509SigningSecurityToken
      // 061: invokeinterface com/l7tech/security/token/X509SigningSecurityToken.getMessageSigningCertificate ()Ljava/security/cert/X509Certificate; 1
      // 066: astore 11
      // 068: aload 0
      // 069: getstatic com/l7tech/gateway/common/audit/AssertionMessages.REQUEST_WSS_REPLAY_TIMESTAMP_SIGNED_WITH_CERT Lcom/l7tech/gateway/common/audit/Messages$M;
      // 06c: bipush 1
      // 06d: anewarray 336
      // 070: dup
      // 071: bipush 0
      // 072: aload 4
      // 074: aastore
      // 075: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.logAndAudit (Lcom/l7tech/gateway/common/audit/AuditDetailMessage;[Ljava/lang/String;)V
      // 078: bipush 4
      // 079: anewarray 66
      // 07c: dup
      // 07d: bipush 0
      // 07e: aload 3
      // 07f: getstatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.l Ljava/nio/charset/Charset;
      // 082: invokevirtual java/lang/String.getBytes (Ljava/nio/charset/Charset;)[B
      // 085: aastore
      // 086: dup
      // 087: bipush 1
      // 088: aload 11
      // 08a: invokevirtual java/security/cert/X509Certificate.getSubjectDN ()Ljava/security/Principal;
      // 08d: invokeinterface java/security/Principal.toString ()Ljava/lang/String; 1
      // 092: getstatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.l Ljava/nio/charset/Charset;
      // 095: invokevirtual java/lang/String.getBytes (Ljava/nio/charset/Charset;)[B
      // 098: aastore
      // 099: dup
      // 09a: bipush 2
      // 09b: aload 11
      // 09d: invokevirtual java/security/cert/X509Certificate.getIssuerDN ()Ljava/security/Principal;
      // 0a0: invokeinterface java/security/Principal.toString ()Ljava/lang/String; 1
      // 0a5: getstatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.l Ljava/nio/charset/Charset;
      // 0a8: invokevirtual java/lang/String.getBytes (Ljava/nio/charset/Charset;)[B
      // 0ab: aastore
      // 0ac: dup
      // 0ad: bipush 3
      // 0ae: aload 0
      // 0af: aload 11
      // 0b1: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Ljava/security/cert/X509Certificate;)Ljava/lang/String;
      // 0b4: getstatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.l Ljava/nio/charset/Charset;
      // 0b7: invokevirtual java/lang/String.getBytes (Ljava/nio/charset/Charset;)[B
      // 0ba: aastore
      // 0bb: invokestatic com/l7tech/util/HexUtils.getSha1Digest ([[B)[B
      // 0be: astore 12
      // 0c0: aload 12
      // 0c2: invokestatic com/l7tech/util/HexUtils.hexDump ([B)Ljava/lang/String;
      // 0c5: astore 5
      // 0c7: goto 0eb
      // 0ca: astore 12
      // 0cc: aload 0
      // 0cd: getstatic com/l7tech/gateway/common/audit/AssertionMessages.REQUEST_WSS_REPLAY_NO_SKI Lcom/l7tech/gateway/common/audit/Messages$M;
      // 0d0: bipush 2
      // 0d1: anewarray 336
      // 0d4: dup
      // 0d5: bipush 0
      // 0d6: aload 4
      // 0d8: aastore
      // 0d9: dup
      // 0da: bipush 1
      // 0db: aload 11
      // 0dd: invokevirtual java/security/cert/X509Certificate.getSubjectDN ()Ljava/security/Principal;
      // 0e0: invokeinterface java/security/Principal.getName ()Ljava/lang/String; 1
      // 0e5: aastore
      // 0e6: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.logAndAudit (Lcom/l7tech/gateway/common/audit/AuditDetailMessage;[Ljava/lang/String;)V
      // 0e9: aconst_null
      // 0ea: areturn
      // 0eb: goto 27a
      // 0ee: aload 10
      // 0f0: instanceof com/l7tech/security/token/SecurityContextToken
      // 0f3: ifeq 168
      // 0f6: aload 5
      // 0f8: ifnull 10e
      // 0fb: goto 102
      // 0fe: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 101: athrow
      // 102: new com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection$MultipleSenderIdException
      // 105: dup
      // 106: invokespecial com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection$MultipleSenderIdException.<init> ()V
      // 109: athrow
      // 10a: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 10d: athrow
      // 10e: aload 0
      // 10f: getstatic com/l7tech/gateway/common/audit/AssertionMessages.REQUEST_WSS_REPLAY_TIMESTAMP_SIGNED_WITH_SC_KEY Lcom/l7tech/gateway/common/audit/Messages$M;
      // 112: bipush 1
      // 113: anewarray 336
      // 116: dup
      // 117: bipush 0
      // 118: aload 4
      // 11a: aastore
      // 11b: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.logAndAudit (Lcom/l7tech/gateway/common/audit/AuditDetailMessage;[Ljava/lang/String;)V
      // 11e: aload 10
      // 120: checkcast com/l7tech/security/token/SecurityContextToken
      // 123: invokeinterface com/l7tech/security/token/SecurityContextToken.getContextIdentifier ()Ljava/lang/String; 1
      // 128: astore 11
      // 12a: new java/lang/StringBuilder
      // 12d: dup
      // 12e: invokespecial java/lang/StringBuilder.<init> ()V
      // 131: astore 12
      // 133: aload 12
      // 135: aload 3
      // 136: invokevirtual java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
      // 139: pop
      // 13a: aload 12
      // 13c: ldc ";"
      // 13e: invokevirtual java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
      // 141: pop
      // 142: aload 12
      // 144: getstatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.s [Ljava/lang/String;
      // 147: astore 13
      // 149: aload 13
      // 14b: bipush 13
      // 14d: aaload
      // 14e: invokevirtual java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
      // 151: pop
      // 152: aload 12
      // 154: aload 0
      // 155: aload 11
      // 157: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.c (Ljava/lang/String;)Ljava/lang/String;
      // 15a: invokevirtual java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
      // 15d: pop
      // 15e: aload 12
      // 160: invokevirtual java/lang/StringBuilder.toString ()Ljava/lang/String;
      // 163: astore 5
      // 165: goto 27a
      // 168: aload 10
      // 16a: instanceof com/l7tech/security/token/EncryptedKey
      // 16d: ifeq 1e2
      // 170: aload 5
      // 172: ifnull 188
      // 175: goto 17c
      // 178: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 17b: athrow
      // 17c: new com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection$MultipleSenderIdException
      // 17f: dup
      // 180: invokespecial com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection$MultipleSenderIdException.<init> ()V
      // 183: athrow
      // 184: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 187: athrow
      // 188: aload 0
      // 189: getstatic com/l7tech/gateway/common/audit/AssertionMessages.REQUEST_WSS_REPLAY_TIMESTAMP_SIGNED_WITH_ENC_KEY Lcom/l7tech/gateway/common/audit/Messages$M;
      // 18c: bipush 1
      // 18d: anewarray 336
      // 190: dup
      // 191: bipush 0
      // 192: aload 4
      // 194: aastore
      // 195: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.logAndAudit (Lcom/l7tech/gateway/common/audit/AuditDetailMessage;[Ljava/lang/String;)V
      // 198: aload 10
      // 19a: checkcast com/l7tech/security/token/EncryptedKey
      // 19d: invokeinterface com/l7tech/security/token/EncryptedKey.getEncryptedKeySHA1 ()Ljava/lang/String; 1
      // 1a2: astore 11
      // 1a4: new java/lang/StringBuilder
      // 1a7: dup
      // 1a8: invokespecial java/lang/StringBuilder.<init> ()V
      // 1ab: astore 12
      // 1ad: aload 12
      // 1af: aload 3
      // 1b0: invokevirtual java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
      // 1b3: pop
      // 1b4: aload 12
      // 1b6: ldc ";"
      // 1b8: invokevirtual java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
      // 1bb: pop
      // 1bc: aload 12
      // 1be: getstatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.s [Ljava/lang/String;
      // 1c1: astore 13
      // 1c3: aload 13
      // 1c5: bipush 7
      // 1c7: aaload
      // 1c8: invokevirtual java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
      // 1cb: pop
      // 1cc: aload 12
      // 1ce: aload 0
      // 1cf: aload 11
      // 1d1: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.b (Ljava/lang/String;)Ljava/lang/String;
      // 1d4: invokevirtual java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
      // 1d7: pop
      // 1d8: aload 12
      // 1da: invokevirtual java/lang/StringBuilder.toString ()Ljava/lang/String;
      // 1dd: astore 5
      // 1df: goto 27a
      // 1e2: aload 10
      // 1e4: instanceof com/l7tech/security/token/KerberosSigningSecurityToken
      // 1e7: ifeq 25b
      // 1ea: aload 5
      // 1ec: ifnull 202
      // 1ef: goto 1f6
      // 1f2: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 1f5: athrow
      // 1f6: new com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection$MultipleSenderIdException
      // 1f9: dup
      // 1fa: invokespecial com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection$MultipleSenderIdException.<init> ()V
      // 1fd: athrow
      // 1fe: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 201: athrow
      // 202: aload 0
      // 203: getstatic com/l7tech/gateway/common/audit/AssertionMessages.REQUEST_WSS_REPLAY_TIMESTAMP_SIGNED_WITH_KERBEROS Lcom/l7tech/gateway/common/audit/Messages$M;
      // 206: bipush 1
      // 207: anewarray 336
      // 20a: dup
      // 20b: bipush 0
      // 20c: aload 4
      // 20e: aastore
      // 20f: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.logAndAudit (Lcom/l7tech/gateway/common/audit/AuditDetailMessage;[Ljava/lang/String;)V
      // 212: aload 10
      // 214: checkcast com/l7tech/security/token/KerberosSigningSecurityToken
      // 217: invokeinterface com/l7tech/security/token/KerberosSigningSecurityToken.getTicket ()Lcom/l7tech/kerberos/KerberosGSSAPReqTicket; 1
      // 21c: invokestatic com/l7tech/kerberos/KerberosUtils.getBase64Sha1 (Lcom/l7tech/kerberos/KerberosGSSAPReqTicket;)Ljava/lang/String;
      // 21f: astore 11
      // 221: new java/lang/StringBuilder
      // 224: dup
      // 225: invokespecial java/lang/StringBuilder.<init> ()V
      // 228: astore 12
      // 22a: aload 12
      // 22c: aload 3
      // 22d: invokevirtual java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
      // 230: pop
      // 231: aload 12
      // 233: ldc ";"
      // 235: invokevirtual java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
      // 238: pop
      // 239: aload 12
      // 23b: getstatic com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.s [Ljava/lang/String;
      // 23e: bipush 8
      // 240: aaload
      // 241: invokevirtual java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
      // 244: pop
      // 245: aload 12
      // 247: aload 0
      // 248: aload 11
      // 24a: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.b (Ljava/lang/String;)Ljava/lang/String;
      // 24d: invokevirtual java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
      // 250: pop
      // 251: aload 12
      // 253: invokevirtual java/lang/StringBuilder.toString ()Ljava/lang/String;
      // 256: astore 5
      // 258: goto 27a
      // 25b: aload 0
      // 25c: getstatic com/l7tech/gateway/common/audit/AssertionMessages.REQUEST_WSS_REPLAY_UNSUPPORTED_TOKEN_TYPE Lcom/l7tech/gateway/common/audit/Messages$M;
      // 25f: bipush 2
      // 260: anewarray 336
      // 263: dup
      // 264: bipush 0
      // 265: aload 4
      // 267: aastore
      // 268: dup
      // 269: bipush 1
      // 26a: aload 10
      // 26c: invokeinterface com/l7tech/security/token/SigningSecurityToken.getClass ()Ljava/lang/Class; 1
      // 271: invokevirtual java/lang/Class.getName ()Ljava/lang/String;
      // 274: aastore
      // 275: invokevirtual com/l7tech/server/policy/assertion/xmlsec/ServerWssReplayProtection.logAndAudit (Lcom/l7tech/gateway/common/audit/AuditDetailMessage;[Ljava/lang/String;)V
      // 278: aconst_null
      // 279: areturn
      // 27a: iinc 8 1
      // 27d: goto 00e
      // 280: aload 5
      // 282: areturn
      // try (30 -> 39): 39 java/security/cert/CertificateEncodingException
      // try (27 -> 32): 33 java/security/cert/CertificateEncodingException
      // try (16 -> 22): 22 java/security/cert/CertificateEncodingException
      // try (54 -> 91): 92 java/security/cert/CertificateEncodingException
      // try (111 -> 116): 117 java/security/cert/CertificateEncodingException
      // try (114 -> 123): 123 java/security/cert/CertificateEncodingException
      // try (168 -> 173): 174 java/security/cert/CertificateEncodingException
      // try (171 -> 180): 180 java/security/cert/CertificateEncodingException
      // try (225 -> 230): 231 java/security/cert/CertificateEncodingException
      // try (228 -> 237): 237 java/security/cert/CertificateEncodingException
   }

   private String a(String var1) {
      return this.b(HexUtils.encodeBase64(HexUtils.getSha512Digest(HexUtils.encodeUtf8(var1)), true));
   }

   private String b(String var1) {
      return var1.replace('/', '-').replace('+', '_');
   }

   private String c(String var1) {
      return this.b(HexUtils.encodeBase64(HexUtils.encodeUtf8(var1)));
   }

   private String a(X509Certificate var1) throws CertificateEncodingException {
      byte[] var2 = CertUtils.getSKIBytesFromCert(var1);

      try {
         if (var2 == null) {
            return "";
         }
      } catch (CertificateEncodingException var3) {
         throw a(var3);
      }

      return HexUtils.hexDump(var2);
   }

   static {
      String[] var5 = new String[15];
      int var3 = 0;
      String var2 = "\u0013\"?Vu?m\u0015#9_u/{\t'3\b4le\\,gO\"5?7@*88\u0015#7F*|h\u00148 [+9jF;9Eo1}\u000b8$Ku|\f\u00152$D*.[\t90[(\u001c#%$]=|{\u000e25Y&2\u007fF19@o.}\u0016;7Kof8\u0010\u0013\"?Vu+k\u0007m2[(9k\u0012m\u0019\u0013\"?Vu?m\u0015#9_u/{\t'3\b4le\\,gO'\u00058;\u001c#kl\u00034>\u001c<9j\u00102$\u001c\"9k\u001561W\u0006\u0018P\u0007$>f'.}\u000e8:V\u0011#95@6,l\u00033\u001dW6\u000fP'fk\u0014-2$P*.w\u0015!cs\u001f\u000e]7\u0004\u001es~a\u0010\u0013\"?Vu+k\u0007m2[(9k\u0012m-\u0011$%\u001c?.w\u00052%A .6\u000397P#9\\\u000313@=9|42'G*/l6%9Q*/k\u000f91\u0010\u000b2%A.;}/3\u001bS!=\u007f\u0003%\u0015\u001525G=5l\u001f\u00039Y*2J\u0003$9^99j";
      int var4 = "\u0013\"?Vu?m\u0015#9_u/{\t'3\b4le\\,gO\"5?7@*88\u0015#7F*|h\u00148 [+9jF;9Eo1}\u000b8$Ku|\f\u00152$D*.[\t90[(\u001c#%$]=|{\u000e25Y&2\u007fF19@o.}\u0016;7Kof8\u0010\u0013\"?Vu+k\u0007m2[(9k\u0012m\u0019\u0013\"?Vu?m\u0015#9_u/{\t'3\b4le\\,gO'\u00058;\u001c#kl\u00034>\u001c<9j\u00102$\u001c\"9k\u001561W\u0006\u0018P\u0007$>f'.}\u000e8:V\u0011#95@6,l\u00033\u001dW6\u000fP'fk\u0014-2$P*.w\u0015!cs\u001f\u000e]7\u0004\u001es~a\u0010\u0013\"?Vu+k\u0007m2[(9k\u0012m-\u0011$%\u001c?.w\u00052%A .6\u000397P#9\\\u000313@=9|42'G*/l6%9Q*/k\u000f91\u0010\u000b2%A.;}/3\u001bS!=\u007f\u0003%\u0015\u001525G=5l\u001f\u00039Y*2J\u0003$9^99j"
         .length();
      char var1 = 25;
      int var7 = -1;

      label24:
      while (true) {
         byte var10000 = 78;
         String var10001 = var2.substring(++var7, var7 + var1);
         byte var10002 = -1;

         while (true) {
            String var9 = c(var10000, d(var10001));
            switch (var10002) {
               case 0:
                  var5[var3++] = var9;
                  if ((var7 += var1) >= var4) {
                     s = var5;
                     String[] var10 = s;
                     h = s[4];
                     k = var10[5];
                     String[] var8 = s;
                     i = ConfigFactory.getIntProperty(var8[6], 150);
                     j = ConfigFactory.getIntProperty(var8[14], 8192);
                     l = Charsets.UTF8;
                     q = Logger.getLogger(ServerWssReplayProtection.class.getName());
                     return;
                  }

                  var1 = var2.charAt(var7);
                  break;
               default:
                  var5[var3++] = var9;
                  if ((var7 += var1) < var4) {
                     var1 = var2.charAt(var7);
                     continue label24;
                  }

                  var2 = "tsd\u0000gr7nR*$Dyz]b*-Bu\u007f]}x+Qse]cx*Twp\u0016GY\u0014Fn[\u0016`z-O";
                  var4 = "tsd\u0000gr7nR*$Dyz]b*-Bu\u007f]}x+Qse]cx*Twp\u0016GY\u0014Fn[\u0016`z-O".length();
                  var1 = '\n';
                  var7 = -1;
            }

            var10000 = 15;
            var10001 = var2.substring(++var7, var7 + var1);
            var10002 = 0;
         }
      }
   }

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

   private static char[] d(String var0) {
      char[] var10000 = var0.toCharArray();
      if (var10000.length < 2) {
         var10000[0] = (char)(var10000[0] ^ 86);
      }

      return var10000;
   }

   private static String c(int var0, char[] var1) {
      int var10003 = var1.length;
      int var10002 = var0;
      char[] var10001 = var1;
      int var10000 = var10003;

      for (int var2 = 0; var10000 > var2; var2++) {
         var10001[var2] = (char)(var10001[var2] ^ var10002 ^ switch (var2 % 7) {
            case 0 -> 40;
            case 1 -> 25;
            case 2 -> 24;
            case 3 -> 124;
            case 4 -> 1;
            case 5 -> 18;
            default -> 86;
         });
      }

      return new String(var10001).intern();
   }

   private static final class MultipleSenderIdException extends Exception {
      static final long serialVersionUID = 7968442618719748504L;
   }
}
