/// <summary>
        /// Creates an instance of <see cref="SecurityTokenHandlerCollection"/>.
        /// Creates an empty set.
        /// </summary>
        /// <param name="configuration">The configuration to associate with the collection.</param>
        public SecurityTokenHandlerCollection(SecurityTokenHandlerConfiguration configuration)
        {
            if (configuration == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("configuration");
            }

            this.configuration     = configuration;
            this.keyInfoSerializer = new KeyInfoSerializer(true);
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes an instance of <see cref="SecurityTokenSerializerAdapter"/>
        /// </summary>
        /// <param name="securityTokenHandlerCollection">
        /// The <see cref="SecurityTokenHandlerCollection" /> containing the set of <see cref="SecurityTokenHandler" />
        /// </param>
        public SecurityTokenSerializerAdapter(SecurityTokenHandlerCollection securityTokenHandlerCollection)
        {
            if (securityTokenHandlerCollection == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("securityTokenHandlerCollection");
            }
            _securityTokenHandlers = securityTokenHandlerCollection;

            KeyInfoSerializer serializer = securityTokenHandlerCollection.KeyInfoSerializer as KeyInfoSerializer;

            if (serializer != null)
            {
                serializer.InnerSecurityTokenSerializer = this;
            }
        }
 public EncryptedKeyClauseEntry(KeyInfoSerializer securityTokenSerializer)
 {
     this.securityTokenSerializer = securityTokenSerializer;
 }
 public XmlEncApr2001(KeyInfoSerializer securityTokenSerializer)
 {
     this.securityTokenSerializer = securityTokenSerializer;
 }
 public KeyInfoEntry( KeyInfoSerializer securityTokenSerializer )
 {
     this.securityTokenSerializer = securityTokenSerializer;
 }
 public XmlDsigSep2000( KeyInfoSerializer securityTokenSerializer )
 {
     this.securityTokenSerializer = securityTokenSerializer;
 }
 public WSSecurityXXX2005(KeyInfoSerializer securityTokenSerializer)
     : base(securityTokenSerializer)
 {
 }
Esempio n. 8
0
 public EncryptedKeyClauseEntry(KeyInfoSerializer securityTokenSerializer)
 {
     this.securityTokenSerializer = securityTokenSerializer;
 }
 public WSSecureConversationDec2005( KeyInfoSerializer securityTokenSerializer )
     : base( securityTokenSerializer )
 {
 }
Esempio n. 10
0
 public WSTrust(KeyInfoSerializer securityTokenSerializer, TrustDictionary serializerDictionary)
 {
     this.securityTokenSerializer = securityTokenSerializer;
     this.serializerDictionary = serializerDictionary;
 }
Esempio n. 11
0
 public KeyInfoEntry(KeyInfoSerializer securityTokenSerializer)
 {
     this.securityTokenSerializer = securityTokenSerializer;
 }
Esempio n. 12
0
 public XmlDsigSep2000(KeyInfoSerializer securityTokenSerializer)
 {
     this.securityTokenSerializer = securityTokenSerializer;
 }
 public LocalReferenceStrEntry(bool emitBspRequiredAttributes, KeyInfoSerializer tokenSerializer)
 {
     this.emitBspRequiredAttributes = emitBspRequiredAttributes;
     this.tokenSerializer = tokenSerializer;
 }
 public WSSecurityJan2004(KeyInfoSerializer securityTokenSerializer)
 {
     this.securityTokenSerializer = securityTokenSerializer;
 }
Esempio n. 15
0
 public WSSecurityJan2004(KeyInfoSerializer securityTokenSerializer)
 {
     this.securityTokenSerializer = securityTokenSerializer;
 }
        public WSSecurityTokenSerializer(SecurityVersion securityVersion, TrustVersion trustVersion, SecureConversationVersion secureConversationVersion, bool emitBspRequiredAttributes, SamlSerializer samlSerializer, SecurityStateEncoder securityStateEncoder, IEnumerable<Type> knownTypes,
            int maximumKeyDerivationOffset, int maximumKeyDerivationLabelLength, int maximumKeyDerivationNonceLength)
        {
            if (securityVersion == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("securityVersion"));

            if (maximumKeyDerivationOffset < 0)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("maximumKeyDerivationOffset", SR.GetString(SR.ValueMustBeNonNegative)));
            }
            if (maximumKeyDerivationLabelLength < 0)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("maximumKeyDerivationLabelLength", SR.GetString(SR.ValueMustBeNonNegative)));
            }
            if (maximumKeyDerivationNonceLength <= 0)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("maximumKeyDerivationNonceLength", SR.GetString(SR.ValueMustBeGreaterThanZero)));
            }

            this.securityVersion = securityVersion;
            this.emitBspRequiredAttributes = emitBspRequiredAttributes;
            this.maximumKeyDerivationOffset = maximumKeyDerivationOffset;
            this.maximumKeyDerivationNonceLength = maximumKeyDerivationNonceLength;
            this.maximumKeyDerivationLabelLength = maximumKeyDerivationLabelLength;

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

            if (secureConversationVersion == SecureConversationVersion.WSSecureConversationFeb2005)
            {
                this.secureConversation = new WSSecureConversationFeb2005(this, securityStateEncoder, knownTypes, maximumKeyDerivationOffset, maximumKeyDerivationLabelLength, maximumKeyDerivationNonceLength);
            }
            else if (secureConversationVersion == SecureConversationVersion.WSSecureConversation13)
            {
                this.secureConversation = new WSSecureConversationDec2005(this, securityStateEncoder, knownTypes, maximumKeyDerivationOffset, maximumKeyDerivationLabelLength, maximumKeyDerivationNonceLength);
            }
            else
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException());
            }

            if (securityVersion == SecurityVersion.WSSecurity10)
            {
                this.serializerEntries.Add(new WSSecurityJan2004(this, samlSerializer));
            }
            else if (securityVersion == SecurityVersion.WSSecurity11)
            {
                this.serializerEntries.Add(new WSSecurityXXX2005(this, samlSerializer));
            }
            else
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("securityVersion", SR.GetString(SR.MessageSecurityVersionOutOfRange)));
            }
            this.serializerEntries.Add(this.secureConversation);
            IdentityModel.TrustDictionary trustDictionary;
            if (trustVersion == TrustVersion.WSTrustFeb2005)
            {
                this.serializerEntries.Add(new WSTrustFeb2005(this));
                trustDictionary = new IdentityModel.TrustFeb2005Dictionary(new CollectionDictionary(DXD.TrustDec2005Dictionary.Feb2005DictionaryStrings));
            }
            else if (trustVersion == TrustVersion.WSTrust13)
            {
                this.serializerEntries.Add(new WSTrustDec2005(this));
                trustDictionary = new IdentityModel.TrustDec2005Dictionary(new CollectionDictionary(DXD.TrustDec2005Dictionary.Dec2005DictionaryString));
            }
            else
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException());
            }

            this.tokenEntries = new List<TokenEntry>();

            for (int i = 0; i < this.serializerEntries.Count; ++i)
            {
                SerializerEntries serializerEntry = this.serializerEntries[i];
                serializerEntry.PopulateTokenEntries(this.tokenEntries);
            }

            IdentityModel.DictionaryManager dictionaryManager = new IdentityModel.DictionaryManager(ServiceModelDictionary.CurrentVersion);
            dictionaryManager.SecureConversationDec2005Dictionary = new IdentityModel.SecureConversationDec2005Dictionary(new CollectionDictionary(DXD.SecureConversationDec2005Dictionary.SecureConversationDictionaryStrings));
            dictionaryManager.SecurityAlgorithmDec2005Dictionary = new IdentityModel.SecurityAlgorithmDec2005Dictionary(new CollectionDictionary(DXD.SecurityAlgorithmDec2005Dictionary.SecurityAlgorithmDictionaryStrings));

            this.keyInfoSerializer = new WSKeyInfoSerializer(this.emitBspRequiredAttributes, dictionaryManager, trustDictionary, this, securityVersion, secureConversationVersion);
        }
Esempio n. 17
0
 public LocalReferenceStrEntry(bool emitBspRequiredAttributes, KeyInfoSerializer tokenSerializer)
 {
     this.emitBspRequiredAttributes = emitBspRequiredAttributes;
     this.tokenSerializer           = tokenSerializer;
 }
Esempio n. 18
0
 public WSSecurityXXX2005(KeyInfoSerializer securityTokenSerializer)
     : base(securityTokenSerializer)
 {
 }
 protected WSSecureConversation( KeyInfoSerializer securityTokenSerializer )
 {
     this.securityTokenSerializer = securityTokenSerializer;
 }
Esempio n. 20
0
 public XmlEncApr2001(KeyInfoSerializer securityTokenSerializer)
 {
     this.securityTokenSerializer = securityTokenSerializer;
 }