public KeyInfoSerializer(
     bool emitBspRequiredAttributes,
     DictionaryManager dictionaryManager,
     TrustDictionary trustDictionary,
     SecurityTokenSerializer innerSecurityTokenSerializer ) :
     this( emitBspRequiredAttributes, dictionaryManager, trustDictionary, innerSecurityTokenSerializer, null )
 {
 }
        public KeyInfoSerializer(
            bool emitBspRequiredAttributes,
            DictionaryManager dictionaryManager,
            TrustDictionary trustDictionary,
            SecurityTokenSerializer innerSecurityTokenSerializer,
            Func<KeyInfoSerializer, IEnumerable<SerializerEntries>> additionalEntries)
        {
            this.dictionaryManager = dictionaryManager;
            this.emitBspRequiredAttributes = emitBspRequiredAttributes;
            this.innerSecurityTokenSerializer = innerSecurityTokenSerializer;

            this.serializerEntries = new List<SecurityTokenSerializer.SerializerEntries>();

            this.serializerEntries.Add(new XmlDsigSep2000(this));
            this.serializerEntries.Add(new XmlEncApr2001(this));
            this.serializerEntries.Add(new System.IdentityModel.Security.WSTrust(this, trustDictionary));
            if ( additionalEntries != null )
            {
                foreach ( SerializerEntries entries in additionalEntries( this ) )
                {
                    this.serializerEntries.Add(entries);
                }
            }

            bool wsSecuritySerializerFound = false;
            foreach ( SerializerEntries entry in this.serializerEntries )
            {
                if ( ( entry is WSSecurityXXX2005 ) || ( entry is WSSecurityJan2004 ) )
                {
                    wsSecuritySerializerFound = true;
                    break;
                }
            }

            if ( !wsSecuritySerializerFound )
            {
                this.serializerEntries.Add( new WSSecurityXXX2005( this ) );
            }

            this.tokenEntries = new List<TokenEntry>();
            this.keyIdentifierEntries = new List<SecurityTokenSerializer.KeyIdentifierEntry>();
            this.keyIdentifierClauseEntries = new List<SecurityTokenSerializer.KeyIdentifierClauseEntry>();

            for (int i = 0; i < this.serializerEntries.Count; ++i)
            {
                SecurityTokenSerializer.SerializerEntries serializerEntry = this.serializerEntries[i];
                serializerEntry.PopulateTokenEntries(this.tokenEntries);
                serializerEntry.PopulateKeyIdentifierEntries(this.keyIdentifierEntries);
                serializerEntry.PopulateKeyIdentifierClauseEntries(this.keyIdentifierClauseEntries);
            }
        }
Ejemplo n.º 3
0
            public BinarySecretClauseEntry(WSTrust parent)
            {
                this.parent = parent;

                this.otherDictionary = null;

                if (parent.SerializerDictionary is TrustDec2005Dictionary)
                {
                    this.otherDictionary = parent.securityTokenSerializer.DictionaryManager.TrustFeb2005Dictionary;
                }

                if (parent.SerializerDictionary is TrustFeb2005Dictionary)
                {
                    this.otherDictionary = parent.securityTokenSerializer.DictionaryManager.TrustDec2005Dictionary;
                }

                // always set it, so we don't have to worry about null
                if (this.otherDictionary == null)
                    this.otherDictionary = this.parent.SerializerDictionary;
            }
Ejemplo n.º 4
0
 public WSKeyInfoSerializer(bool emitBspRequiredAttributes, DictionaryManager dictionaryManager, System.IdentityModel.TrustDictionary trustDictionary, SecurityTokenSerializer innerSecurityTokenSerializer, SecurityVersion securityVersion, SecureConversationVersion secureConversationVersion)
     : base(emitBspRequiredAttributes, dictionaryManager, trustDictionary, innerSecurityTokenSerializer, CreateAdditionalEntries(securityVersion, secureConversationVersion))
 {
 }
Ejemplo n.º 5
0
 public WSTrust(KeyInfoSerializer securityTokenSerializer, TrustDictionary serializerDictionary)
 {
     this.securityTokenSerializer = securityTokenSerializer;
     this.serializerDictionary = serializerDictionary;
 }