public virtual ClaimSet ExtractSubjectKeyClaimSet(SamlSecurityTokenAuthenticator samlAuthenticator)
 {
     if ((this.subjectKeyClaimset == null) && (this.securityKeyIdentifier != null))
     {
         if (samlAuthenticator == null)
         {
             throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("samlAuthenticator");
         }
         if (this.subjectToken != null)
         {
             this.subjectKeyClaimset = samlAuthenticator.ResolveClaimSet(this.subjectToken);
             this.identity = samlAuthenticator.ResolveIdentity(this.subjectToken);
             if ((this.identity == null) && (this.subjectKeyClaimset != null))
             {
                 Claim claim = null;
                 foreach (Claim claim2 in this.subjectKeyClaimset.FindClaims(null, Rights.Identity))
                 {
                     claim = claim2;
                     break;
                 }
                 if (claim != null)
                 {
                     this.identity = System.IdentityModel.SecurityUtils.CreateIdentity(claim.Resource.ToString(), base.GetType().Name);
                 }
             }
         }
         if (this.subjectKeyClaimset == null)
         {
             this.subjectKeyClaimset = samlAuthenticator.ResolveClaimSet(this.securityKeyIdentifier);
             this.identity = samlAuthenticator.ResolveIdentity(this.securityKeyIdentifier);
         }
     }
     return this.subjectKeyClaimset;
 }
 public override IIdentity CreateIdentity()
 {
     return(authenticator.ResolveIdentity(token));
 }