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

import com.l7tech.message.Message;
import com.l7tech.policy.assertion.PolicyAssertionException;
import com.l7tech.security.xml.decorator.DecorationRequirements;
import com.l7tech.server.message.AuthenticationContext;
import com.l7tech.server.message.PolicyEnforcementContext;
import org.w3c.dom.Document;

class p implements AddWssSignatureSupport.SignedElementSelector {
   final ServerAddWssSecurityToken this$0;

   p(ServerAddWssSecurityToken var1) {
      this.this$0 = var1;
   }

   @Override
   public int selectElementsToSign(
      PolicyEnforcementContext param1, AuthenticationContext param2, Document param3, DecorationRequirements param4, Message param5
   ) throws PolicyAssertionException {
      // $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 1
      // 001: invokeinterface com/l7tech/server/message/PolicyEnforcementContext.getDefaultAuthenticationContext ()Lcom/l7tech/server/message/AuthenticationContext; 1
      // 006: invokevirtual com/l7tech/server/message/AuthenticationContext.getLastCredentials ()Lcom/l7tech/policy/assertion/credential/LoginCredentials;
      // 009: astore 6
      // 00b: aload 6
      // 00d: ifnonnull 018
      // 010: aconst_null
      // 011: goto 01d
      // 014: invokestatic com/l7tech/server/policy/assertion/xmlsec/p.a (Lcom/l7tech/policy/assertion/PolicyAssertionException;)Lcom/l7tech/policy/assertion/PolicyAssertionException;
      // 017: athrow
      // 018: aload 6
      // 01a: invokevirtual com/l7tech/policy/assertion/credential/LoginCredentials.getLogin ()Ljava/lang/String;
      // 01d: astore 7
      // 01f: aconst_null
      // 020: astore 8
      // 022: aload 6
      // 024: ifnull 043
      // 027: aload 6
      // 029: invokevirtual com/l7tech/policy/assertion/credential/LoginCredentials.getFormat ()Lcom/l7tech/policy/assertion/credential/CredentialFormat;
      // 02c: getstatic com/l7tech/policy/assertion/credential/CredentialFormat.CLEARTEXT Lcom/l7tech/policy/assertion/credential/CredentialFormat;
      // 02f: if_acmpne 043
      // 032: goto 039
      // 035: invokestatic com/l7tech/server/policy/assertion/xmlsec/p.a (Lcom/l7tech/policy/assertion/PolicyAssertionException;)Lcom/l7tech/policy/assertion/PolicyAssertionException;
      // 038: athrow
      // 039: aload 6
      // 03b: invokevirtual com/l7tech/policy/assertion/credential/LoginCredentials.getCredentials ()[C
      // 03e: astore 8
      // 040: goto 0a8
      // 043: aload 6
      // 045: ifnonnull 050
      // 048: aconst_null
      // 049: goto 055
      // 04c: invokestatic com/l7tech/server/policy/assertion/xmlsec/p.a (Lcom/l7tech/policy/assertion/PolicyAssertionException;)Lcom/l7tech/policy/assertion/PolicyAssertionException;
      // 04f: athrow
      // 050: aload 6
      // 052: invokevirtual com/l7tech/policy/assertion/credential/LoginCredentials.getPayload ()Ljava/lang/Object;
      // 055: astore 9
      // 057: aload 9
      // 059: instanceof java/security/cert/X509Certificate
      // 05c: ifeq 075
      // 05f: aload 9
      // 061: checkcast java/security/cert/X509Certificate
      // 064: astore 10
      // 066: aload 10
      // 068: invokevirtual java/security/cert/X509Certificate.getSubjectDN ()Ljava/security/Principal;
      // 06b: invokeinterface java/security/Principal.getName ()Ljava/lang/String; 1
      // 070: astore 7
      // 072: goto 0a8
      // 075: aload 9
      // 077: instanceof com/l7tech/xml/saml/SamlAssertion
      // 07a: ifeq 0a8
      // 07d: aload 9
      // 07f: checkcast com/l7tech/xml/saml/SamlAssertion
      // 082: astore 10
      // 084: aload 10
      // 086: invokevirtual com/l7tech/xml/saml/SamlAssertion.getNameIdentifierValue ()Ljava/lang/String;
      // 089: astore 7
      // 08b: aload 7
      // 08d: ifnonnull 0a8
      // 090: aload 10
      // 092: invokevirtual com/l7tech/xml/saml/SamlAssertion.getSubjectCertificate ()Ljava/security/cert/X509Certificate;
      // 095: astore 11
      // 097: aload 11
      // 099: ifnull 0a8
      // 09c: aload 11
      // 09e: invokevirtual java/security/cert/X509Certificate.getSubjectDN ()Ljava/security/Principal;
      // 0a1: invokeinterface java/security/Principal.getName ()Ljava/lang/String; 1
      // 0a6: astore 7
      // 0a8: aload 7
      // 0aa: ifnonnull 0bd
      // 0ad: aload 0
      // 0ae: getfield com/l7tech/server/policy/assertion/xmlsec/p.this$0 Lcom/l7tech/server/policy/assertion/xmlsec/ServerAddWssSecurityToken;
      // 0b1: getstatic com/l7tech/gateway/common/audit/AssertionMessages.ADD_WSS_TOKEN_NO_USERNAME Lcom/l7tech/gateway/common/audit/Messages$M;
      // 0b4: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerAddWssSecurityToken.access$000 (Lcom/l7tech/server/policy/assertion/xmlsec/ServerAddWssSecurityToken;Lcom/l7tech/gateway/common/audit/AuditDetailMessage;)V
      // 0b7: bipush -1
      // 0b8: ireturn
      // 0b9: invokestatic com/l7tech/server/policy/assertion/xmlsec/p.a (Lcom/l7tech/policy/assertion/PolicyAssertionException;)Lcom/l7tech/policy/assertion/PolicyAssertionException;
      // 0bc: athrow
      // 0bd: aload 0
      // 0be: getfield com/l7tech/server/policy/assertion/xmlsec/p.this$0 Lcom/l7tech/server/policy/assertion/xmlsec/ServerAddWssSecurityToken;
      // 0c1: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerAddWssSecurityToken.access$100 (Lcom/l7tech/server/policy/assertion/xmlsec/ServerAddWssSecurityToken;)Lcom/l7tech/policy/assertion/Assertion;
      // 0c4: checkcast com/l7tech/policy/assertion/xmlsec/AddWssSecurityToken
      // 0c7: invokevirtual com/l7tech/policy/assertion/xmlsec/AddWssSecurityToken.isIncludePassword ()Z
      // 0ca: ifeq 0e9
      // 0cd: aload 8
      // 0cf: ifnonnull 0ec
      // 0d2: goto 0d9
      // 0d5: invokestatic com/l7tech/server/policy/assertion/xmlsec/p.a (Lcom/l7tech/policy/assertion/PolicyAssertionException;)Lcom/l7tech/policy/assertion/PolicyAssertionException;
      // 0d8: athrow
      // 0d9: aload 0
      // 0da: getfield com/l7tech/server/policy/assertion/xmlsec/p.this$0 Lcom/l7tech/server/policy/assertion/xmlsec/ServerAddWssSecurityToken;
      // 0dd: getstatic com/l7tech/gateway/common/audit/AssertionMessages.ADD_WSS_TOKEN_NO_PASSWORD Lcom/l7tech/gateway/common/audit/Messages$M;
      // 0e0: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerAddWssSecurityToken.access$200 (Lcom/l7tech/server/policy/assertion/xmlsec/ServerAddWssSecurityToken;Lcom/l7tech/gateway/common/audit/AuditDetailMessage;)V
      // 0e3: bipush -1
      // 0e4: ireturn
      // 0e5: invokestatic com/l7tech/server/policy/assertion/xmlsec/p.a (Lcom/l7tech/policy/assertion/PolicyAssertionException;)Lcom/l7tech/policy/assertion/PolicyAssertionException;
      // 0e8: athrow
      // 0e9: aconst_null
      // 0ea: astore 8
      // 0ec: aload 4
      // 0ee: new com/l7tech/security/token/UsernameTokenImpl
      // 0f1: dup
      // 0f2: aload 7
      // 0f4: aload 8
      // 0f6: invokespecial com/l7tech/security/token/UsernameTokenImpl.<init> (Ljava/lang/String;[C)V
      // 0f9: invokevirtual com/l7tech/security/xml/decorator/DecorationRequirements.setUsernameTokenCredentials (Lcom/l7tech/security/token/UsernameToken;)V
      // 0fc: aload 0
      // 0fd: getfield com/l7tech/server/policy/assertion/xmlsec/p.this$0 Lcom/l7tech/server/policy/assertion/xmlsec/ServerAddWssSecurityToken;
      // 100: invokestatic com/l7tech/server/policy/assertion/xmlsec/ServerAddWssSecurityToken.access$300 (Lcom/l7tech/server/policy/assertion/xmlsec/ServerAddWssSecurityToken;)Lcom/l7tech/policy/assertion/Assertion;
      // 103: checkcast com/l7tech/policy/assertion/xmlsec/AddWssSecurityToken
      // 106: invokevirtual com/l7tech/policy/assertion/xmlsec/AddWssSecurityToken.isProtectTokens ()Z
      // 109: ifeq 11f
      // 10c: aload 4
      // 10e: bipush 1
      // 10f: invokevirtual com/l7tech/security/xml/decorator/DecorationRequirements.setSignUsernameToken (Z)V
      // 112: aload 4
      // 114: bipush 1
      // 115: invokevirtual com/l7tech/security/xml/decorator/DecorationRequirements.setSignTimestamp (Z)V
      // 118: goto 11f
      // 11b: invokestatic com/l7tech/server/policy/assertion/xmlsec/p.a (Lcom/l7tech/policy/assertion/PolicyAssertionException;)Lcom/l7tech/policy/assertion/PolicyAssertionException;
      // 11e: athrow
      // 11f: bipush 1
      // 120: ireturn
      // try (4 -> 8): 8 com/l7tech/policy/assertion/PolicyAssertionException
      // try (15 -> 21): 22 com/l7tech/policy/assertion/PolicyAssertionException
      // try (28 -> 32): 32 com/l7tech/policy/assertion/PolicyAssertionException
      // try (68 -> 76): 76 com/l7tech/policy/assertion/PolicyAssertionException
      // try (78 -> 86): 87 com/l7tech/policy/assertion/PolicyAssertionException
      // try (84 -> 95): 95 com/l7tech/policy/assertion/PolicyAssertionException
      // try (99 -> 118): 119 com/l7tech/policy/assertion/PolicyAssertionException
   }

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