< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Configuration.SecurityElementBase
Assembly: CoreWCF.ConfigurationManager
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.ConfigurationManager/src/CoreWCF/Configuration/SecurityElementBase.cs
Line coverage
16%
Covered lines: 56
Uncovered lines: 286
Coverable lines: 342
Total lines: 844
Line coverage: 16.3%
Branch coverage
11%
Covered branches: 30
Total branches: 260
Branch coverage: 11.5%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.ConfigurationManager/src/CoreWCF/Configuration/SecurityElementBase.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using System;
 5using System.Collections.Generic;
 6using System.Collections.ObjectModel;
 7using System.ComponentModel;
 8using System.Configuration;
 9using System.Linq;
 10using System.Xml;
 11using CoreWCF.Channels;
 12using CoreWCF.IdentityModel.Tokens;
 13using CoreWCF.Runtime;
 14using CoreWCF.Security;
 15using CoreWCF.Security.Tokens;
 16
 17namespace CoreWCF.Configuration
 18{
 19    public class SecurityElementBase : BindingElementExtensionElement
 20    {
 21        // if you add another variable, make sure to adjust: CopyFrom and UnMerge methods.
 22        private SecurityBindingElement _failedSecurityBindingElement;
 23        private bool _willX509IssuerReferenceAssertionBeWritten;
 24        private SecurityKeyType _templateKeyType = SecurityBindingDefaults.DefaultKeyType;
 25
 626        internal SecurityElementBase()
 27        {
 628        }
 29
 030        internal bool HasImportFailed { get { return _failedSecurityBindingElement != null; } }
 31
 332        internal bool IsSecurityElementBootstrap { get; set; } // Used in serialization path to optimize Xml representat
 33
 34        [ConfigurationProperty(ConfigurationStrings.DefaultAlgorithmSuite, DefaultValue = SecurityBindingDefaults.Defaul
 35        [TypeConverter(typeof(SecurityAlgorithmSuiteConverter))]
 36        public SecurityAlgorithmSuite DefaultAlgorithmSuite
 37        {
 138            get { return (SecurityAlgorithmSuite)base[ConfigurationStrings.DefaultAlgorithmSuite]; }
 039            set { base[ConfigurationStrings.DefaultAlgorithmSuite] = value; }
 40        }
 41
 42        //TODO If AsymmetricSecurityBindingElement is added
 43        //[ConfigurationProperty(ConfigurationStrings.AllowSerializedSigningTokenOnReply, DefaultValue = SecurityBinding
 44        //public bool AllowSerializedSigningTokenOnReply
 45        //{
 46        //    get { return (bool)base[ConfigurationStrings.AllowSerializedSigningTokenOnReply]; }
 47        //    set { base[ConfigurationStrings.AllowSerializedSigningTokenOnReply] = value; }
 48        //}
 49
 50        [ConfigurationProperty(ConfigurationStrings.EnableUnsecuredResponse, DefaultValue = SecurityBindingDefaults.Defa
 51        public bool EnableUnsecuredResponse
 52        {
 153            get { return (bool)base[ConfigurationStrings.EnableUnsecuredResponse]; }
 054            set { base[ConfigurationStrings.EnableUnsecuredResponse] = value; }
 55        }
 56
 57        [ConfigurationProperty(ConfigurationStrings.AuthenticationMode, DefaultValue = SecurityBindingDefaults.DefaultAu
 58        public AuthenticationMode AuthenticationMode
 59        {
 760            get { return (AuthenticationMode)base[ConfigurationStrings.AuthenticationMode]; }
 061            set { base[ConfigurationStrings.AuthenticationMode] = value; }
 62        }
 63
 64        public override Type BindingElementType
 65        {
 1866            get { return typeof(SecurityBindingElement); }
 67        }
 68
 69        [ConfigurationProperty(ConfigurationStrings.RequireDerivedKeys, DefaultValue = SecurityBindingDefaults.DefaultRe
 70        public bool RequireDerivedKeys
 71        {
 172            get { return (bool)base[ConfigurationStrings.RequireDerivedKeys]; }
 073            set { base[ConfigurationStrings.RequireDerivedKeys] = value; }
 74        }
 75
 76        [ConfigurationProperty(ConfigurationStrings.SecurityHeaderLayout, DefaultValue = SecurityBindingDefaults.Default
 77        public SecurityHeaderLayout SecurityHeaderLayout
 78        {
 179            get { return (SecurityHeaderLayout)base[ConfigurationStrings.SecurityHeaderLayout]; }
 080            set { base[ConfigurationStrings.SecurityHeaderLayout] = value; }
 81        }
 82
 83        [ConfigurationProperty(ConfigurationStrings.IncludeTimestamp, DefaultValue = SecurityBindingDefaults.DefaultIncl
 84        public bool IncludeTimestamp
 85        {
 186            get { return (bool)base[ConfigurationStrings.IncludeTimestamp]; }
 087            set { base[ConfigurationStrings.IncludeTimestamp] = value; }
 88        }
 89
 90        [ConfigurationProperty(ConfigurationStrings.AllowInsecureTransport, DefaultValue = SecurityBindingDefaults.Defau
 91        public bool AllowInsecureTransport
 92        {
 193            get { return (bool)base[ConfigurationStrings.AllowInsecureTransport]; }
 094            set { base[ConfigurationStrings.AllowInsecureTransport] = value; }
 95        }
 96
 97        [ConfigurationProperty(ConfigurationStrings.KeyEntropyMode, DefaultValue = SecurityBindingDefaults.DefaultKeyEnt
 98        public SecurityKeyEntropyMode KeyEntropyMode
 99        {
 1100            get { return (SecurityKeyEntropyMode)base[ConfigurationStrings.KeyEntropyMode]; }
 0101            set { base[ConfigurationStrings.KeyEntropyMode] = value; }
 102        }
 103
 104        [ConfigurationProperty(ConfigurationStrings.IssuedTokenParameters)]
 105        public IssuedTokenParametersElement IssuedTokenParameters
 106        {
 2107            get { return (IssuedTokenParametersElement)base[ConfigurationStrings.IssuedTokenParameters]; }
 108        }
 109
 110        [ConfigurationProperty(ConfigurationStrings.LocalServiceSettings)]
 111        public LocalServiceSecuritySettingsElement LocalServiceSettings
 112        {
 1113            get { return (LocalServiceSecuritySettingsElement)base[ConfigurationStrings.LocalServiceSettings]; }
 114        }
 115
 116        [ConfigurationProperty(ConfigurationStrings.MessageProtectionOrder, DefaultValue = SecurityBindingDefaults.Defau
 117        public MessageProtectionOrder MessageProtectionOrder
 118        {
 0119            get { return (MessageProtectionOrder)base[ConfigurationStrings.MessageProtectionOrder]; }
 0120            set { base[ConfigurationStrings.MessageProtectionOrder] = value; }
 121        }
 122
 123        [ConfigurationProperty(ConfigurationStrings.ProtectTokens, DefaultValue = false)]
 124        public bool ProtectTokens
 125        {
 1126            get { return (bool)base[ConfigurationStrings.ProtectTokens]; }
 0127            set { base[ConfigurationStrings.ProtectTokens] = value; }
 128        }
 129
 130        [ConfigurationProperty(ConfigurationStrings.MessageSecurityVersion, DefaultValue = ConfigurationStrings.Default)
 131        [TypeConverter(typeof(MessageSecurityVersionConverter))]
 132        public MessageSecurityVersion MessageSecurityVersion
 133        {
 1134            get { return (MessageSecurityVersion)base[ConfigurationStrings.MessageSecurityVersion]; }
 0135            set { base[ConfigurationStrings.MessageSecurityVersion] = value; }
 136        }
 137
 138        [ConfigurationProperty(ConfigurationStrings.RequireSecurityContextCancellation, DefaultValue = SecurityBindingDe
 139        public bool RequireSecurityContextCancellation
 140        {
 2141            get { return (bool)base[ConfigurationStrings.RequireSecurityContextCancellation]; }
 0142            set { base[ConfigurationStrings.RequireSecurityContextCancellation] = value; }
 143        }
 144
 145        [ConfigurationProperty(ConfigurationStrings.RequireSignatureConfirmation, DefaultValue = SecurityBindingDefaults
 146        public bool RequireSignatureConfirmation
 147        {
 0148            get { return (bool)base[ConfigurationStrings.RequireSignatureConfirmation]; }
 0149            set { base[ConfigurationStrings.RequireSignatureConfirmation] = value; }
 150        }
 151
 152        [ConfigurationProperty(ConfigurationStrings.CanRenewSecurityContextToken, DefaultValue = SecurityBindingDefaults
 153        public bool CanRenewSecurityContextToken
 154        {
 1155            get { return (bool)base[ConfigurationStrings.CanRenewSecurityContextToken]; }
 0156            set { base[ConfigurationStrings.CanRenewSecurityContextToken] = value; }
 157        }
 158
 159        public override void ApplyConfiguration(BindingElement bindingElement)
 160        {
 2161            base.ApplyConfiguration(bindingElement);
 162
 2163            SecurityBindingElement sbe = (SecurityBindingElement)bindingElement;
 164
 2165            if (PropertyValueOrigin.Default != ElementInformation.Properties[ConfigurationStrings.DefaultAlgorithmSuite]
 1166                sbe.DefaultAlgorithmSuite = DefaultAlgorithmSuite;
 2167            if (PropertyValueOrigin.Default != ElementInformation.Properties[ConfigurationStrings.IncludeTimestamp].Valu
 1168                sbe.IncludeTimestamp = IncludeTimestamp;
 2169            if (PropertyValueOrigin.Default != ElementInformation.Properties[ConfigurationStrings.MessageSecurityVersion
 1170                sbe.MessageSecurityVersion = MessageSecurityVersion;
 2171            if (PropertyValueOrigin.Default != ElementInformation.Properties[ConfigurationStrings.KeyEntropyMode].ValueO
 1172                sbe.KeyEntropyMode = KeyEntropyMode;
 2173            if (PropertyValueOrigin.Default != ElementInformation.Properties[ConfigurationStrings.SecurityHeaderLayout].
 1174                sbe.SecurityHeaderLayout = SecurityHeaderLayout;
 2175            if (PropertyValueOrigin.Default != ElementInformation.Properties[ConfigurationStrings.RequireDerivedKeys].Va
 1176                sbe.SetKeyDerivation(RequireDerivedKeys);
 2177            if (PropertyValueOrigin.Default != ElementInformation.Properties[ConfigurationStrings.AllowInsecureTransport
 1178                sbe.AllowInsecureTransport = AllowInsecureTransport;
 2179            if (PropertyValueOrigin.Default != ElementInformation.Properties[ConfigurationStrings.EnableUnsecuredRespons
 1180                sbe.EnableUnsecuredResponse = EnableUnsecuredResponse;
 2181            if (PropertyValueOrigin.Default != ElementInformation.Properties[ConfigurationStrings.ProtectTokens].ValueOr
 1182                sbe.ProtectTokens = ProtectTokens;
 183
 184
 2185            SymmetricSecurityBindingElement ssbe = sbe as SymmetricSecurityBindingElement;
 186
 2187            if (ssbe != null)
 188            {
 0189                if (PropertyValueOrigin.Default != ElementInformation.Properties[ConfigurationStrings.MessageProtectionO
 0190                    ssbe.MessageProtectionOrder = MessageProtectionOrder;
 0191                if (PropertyValueOrigin.Default != ElementInformation.Properties[ConfigurationStrings.RequireSignatureCo
 0192                    ssbe.RequireSignatureConfirmation = RequireSignatureConfirmation;
 0193                SecureConversationSecurityTokenParameters scParameters = ssbe.ProtectionTokenParameters as SecureConvers
 0194                if (scParameters != null)
 195                {
 0196                    scParameters.CanRenewSession = CanRenewSecurityContextToken;
 197                }
 198            }
 199
 200            //TODO If AsymmetricSecurityBindingElement is added
 201            //AsymmetricSecurityBindingElement asbe = sbe as AsymmetricSecurityBindingElement;
 202
 203            //if (asbe != null)
 204            //{
 205            //    if (PropertyValueOrigin.Default != this.ElementInformation.Properties[ConfigurationStrings.MessageProt
 206            //        asbe.MessageProtectionOrder = this.MessageProtectionOrder;
 207            //    if (PropertyValueOrigin.Default != this.ElementInformation.Properties[ConfigurationStrings.RequireSign
 208            //        asbe.RequireSignatureConfirmation = this.RequireSignatureConfirmation;
 209            //    if (PropertyValueOrigin.Default != this.ElementInformation.Properties[ConfigurationStrings.AllowSerial
 210            //        asbe.AllowSerializedSigningTokenOnReply = this.AllowSerializedSigningTokenOnReply;
 211            //}
 212
 2213            TransportSecurityBindingElement tsbe = sbe as TransportSecurityBindingElement;
 214
 2215            if (tsbe != null)
 216            {
 2217                if (tsbe.EndpointSupportingTokenParameters.Endorsing.Count == 1)
 218                {
 2219                    SecureConversationSecurityTokenParameters scParameters = tsbe.EndpointSupportingTokenParameters.Endo
 2220                    if (scParameters != null)
 221                    {
 1222                        scParameters.CanRenewSession = CanRenewSecurityContextToken;
 223                    }
 224                }
 225            }
 226
 2227            if (PropertyValueOrigin.Default != ElementInformation.Properties[ConfigurationStrings.LocalServiceSettings].
 228            {
 1229                LocalServiceSettings.ApplyConfiguration(sbe.LocalServiceSettings);
 230            }
 2231        }
 232
 233        public override void CopyFrom(ServiceModelExtensionElement from)
 234        {
 0235            base.CopyFrom(from);
 236
 0237            SecurityElementBase source = (SecurityElementBase)from;
 238
 239            //TODO If AsymmetricSecurityBindingElement is added
 240            //if (PropertyValueOrigin.Default != source.ElementInformation.Properties[ConfigurationStrings.AllowSerializ
 241            //    this.AllowSerializedSigningTokenOnReply = source.AllowSerializedSigningTokenOnReply;
 0242            if (PropertyValueOrigin.Default != source.ElementInformation.Properties[ConfigurationStrings.DefaultAlgorith
 0243                DefaultAlgorithmSuite = source.DefaultAlgorithmSuite;
 0244            if (PropertyValueOrigin.Default != source.ElementInformation.Properties[ConfigurationStrings.EnableUnsecured
 0245                EnableUnsecuredResponse = source.EnableUnsecuredResponse;
 0246            if (PropertyValueOrigin.Default != source.ElementInformation.Properties[ConfigurationStrings.AllowInsecureTr
 0247                AllowInsecureTransport = source.AllowInsecureTransport;
 0248            if (PropertyValueOrigin.Default != source.ElementInformation.Properties[ConfigurationStrings.RequireDerivedK
 0249                RequireDerivedKeys = source.RequireDerivedKeys;
 0250            if (PropertyValueOrigin.Default != source.ElementInformation.Properties[ConfigurationStrings.IncludeTimestam
 0251                IncludeTimestamp = source.IncludeTimestamp;
 0252            if (PropertyValueOrigin.Default != source.ElementInformation.Properties[ConfigurationStrings.IssuedTokenPara
 0253                this.IssuedTokenParameters.Copy(source.IssuedTokenParameters);
 0254            if (PropertyValueOrigin.Default != source.ElementInformation.Properties[ConfigurationStrings.MessageProtecti
 0255                MessageProtectionOrder = source.MessageProtectionOrder;
 0256            if (PropertyValueOrigin.Default != source.ElementInformation.Properties[ConfigurationStrings.ProtectTokens].
 0257                ProtectTokens = source.ProtectTokens;
 0258            if (PropertyValueOrigin.Default != source.ElementInformation.Properties[ConfigurationStrings.MessageSecurity
 0259                MessageSecurityVersion = source.MessageSecurityVersion;
 0260            if (PropertyValueOrigin.Default != source.ElementInformation.Properties[ConfigurationStrings.RequireSignatur
 0261                RequireSignatureConfirmation = source.RequireSignatureConfirmation;
 0262            if (PropertyValueOrigin.Default != source.ElementInformation.Properties[ConfigurationStrings.RequireSecurity
 0263                RequireSecurityContextCancellation = source.RequireSecurityContextCancellation;
 0264            if (PropertyValueOrigin.Default != source.ElementInformation.Properties[ConfigurationStrings.CanRenewSecurit
 0265                CanRenewSecurityContextToken = source.CanRenewSecurityContextToken;
 0266            if (PropertyValueOrigin.Default != source.ElementInformation.Properties[ConfigurationStrings.KeyEntropyMode]
 0267                KeyEntropyMode = source.KeyEntropyMode;
 0268            if (PropertyValueOrigin.Default != source.ElementInformation.Properties[ConfigurationStrings.SecurityHeaderL
 0269                SecurityHeaderLayout = source.SecurityHeaderLayout;
 0270            if (PropertyValueOrigin.Default != source.ElementInformation.Properties[ConfigurationStrings.LocalServiceSet
 0271                LocalServiceSettings.CopyFrom(source.LocalServiceSettings);
 272
 0273            _failedSecurityBindingElement = source._failedSecurityBindingElement;
 0274            _willX509IssuerReferenceAssertionBeWritten = source._willX509IssuerReferenceAssertionBeWritten;
 0275        }
 276
 277        protected internal override BindingElement CreateBindingElement()
 278        {
 3279            return CreateBindingElement(false);
 280        }
 281
 282        protected internal virtual BindingElement CreateBindingElement(bool createTemplateOnly)
 283        {
 284            SecurityBindingElement result;
 3285            switch (AuthenticationMode)
 286            {
 287                //case AuthenticationMode.AnonymousForCertificate:
 288                //    result = SecurityBindingElement.CreateAnonymousForCertificateBindingElement();
 289                //    break;
 290                //case AuthenticationMode.AnonymousForSslNegotiated:
 291                //    result = SecurityBindingElement.CreateSslNegotiationBindingElement(false, this.RequireSecurityCont
 292                //    break;
 293                case AuthenticationMode.CertificateOverTransport:
 0294                    result = SecurityBindingElement.CreateCertificateOverTransportBindingElement(MessageSecurityVersion)
 0295                    break;
 296                //case AuthenticationMode.IssuedToken:
 297                //    result = SecurityBindingElement.CreateIssuedTokenBindingElement(this.IssuedTokenParameters.Create(
 298                //    break;
 299                case AuthenticationMode.IssuedTokenForCertificate:
 2300                    result = SecurityBindingElement.CreateIssuedTokenForCertificateBindingElement(this.IssuedTokenParame
 0301                    break;
 302                case AuthenticationMode.IssuedTokenForSslNegotiated:
 0303                    result = SecurityBindingElement.CreateIssuedTokenForSslBindingElement(this.IssuedTokenParameters.Cre
 0304                    break;
 305                case AuthenticationMode.IssuedTokenOverTransport:
 0306                    result = SecurityBindingElement.CreateIssuedTokenOverTransportBindingElement(this.IssuedTokenParamet
 0307                    break;
 308                //case AuthenticationMode.Kerberos:
 309                //    result = SecurityBindingElement.CreateKerberosBindingElement();
 310                //    break;
 311                //case AuthenticationMode.KerberosOverTransport:
 312                //    result = SecurityBindingElement.CreateKerberosOverTransportBindingElement();
 313                //    break;
 314                //case AuthenticationMode.MutualCertificateDuplex:
 315                //    result = SecurityBindingElement.CreateMutualCertificateDuplexBindingElement(this.MessageSecurityVe
 316                //    break;
 317                //case AuthenticationMode.MutualCertificate:
 318                //    result = SecurityBindingElement.CreateMutualCertificateBindingElement(this.MessageSecurityVersion)
 319                //    break;
 320                //case AuthenticationMode.MutualSslNegotiated:
 321                //    result = SecurityBindingElement.CreateSslNegotiationBindingElement(true, this.RequireSecurityConte
 322                //    break;
 323                //case AuthenticationMode.SspiNegotiated:
 324                //    result = SecurityBindingElement.CreateSspiNegotiationBindingElement(this.RequireSecurityContextCan
 325                //    break;
 326                //case AuthenticationMode.UserNameForCertificate:
 327                //    result = SecurityBindingElement.CreateUserNameForCertificateBindingElement();
 328                //    break;
 329                //case AuthenticationMode.UserNameForSslNegotiated:
 330                //    result = SecurityBindingElement.CreateUserNameForSslBindingElement(this.RequireSecurityContextCanc
 331                //    break;
 332                case AuthenticationMode.UserNameOverTransport:
 0333                    result = SecurityBindingElement.CreateUserNameOverTransportBindingElement();
 0334                    break;
 335                case AuthenticationMode.SspiNegotiatedOverTransport:
 1336                    result = SecurityBindingElement.CreateSspiNegotiationOverTransportBindingElement(RequireSecurityCont
 1337                    break;
 338                default:
 0339                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidEnumArgumentException(nameof(Au
 340            }
 341
 1342            ApplyConfiguration(result);
 343
 1344            return result;
 345        }
 346
 347        protected void AddBindingTemplate(Dictionary<AuthenticationMode, SecurityBindingElement> bindingTemplates, Authe
 348        {
 0349            AuthenticationMode = mode;
 350            try
 351            {
 0352                bindingTemplates[mode] = (SecurityBindingElement)CreateBindingElement(true);
 0353            }
 354            catch (Exception e)
 355            {
 0356                if (Fx.IsFatal(e))
 357                {
 0358                    throw;
 359                }
 0360            }
 0361        }
 362
 363        private static bool AreTokenParametersMatching(SecurityTokenParameters p1, SecurityTokenParameters p2, bool skip
 364        {
 0365            if (p1 == null || p2 == null)
 0366                return false;
 367
 0368            if (p1.GetType() != p2.GetType())
 0369                return false;
 370
 0371            if (p1.InclusionMode != p2.InclusionMode)
 0372                return false;
 373
 0374            if (skipRequireDerivedKeysComparison == false && p1.RequireDerivedKeys != p2.RequireDerivedKeys)
 0375                return false;
 376
 0377            if (p1.ReferenceStyle != p2.ReferenceStyle)
 0378                return false;
 379
 380            // mutual ssl and anonymous ssl differ in the client cert requirement
 0381            if (p1 is SslSecurityTokenParameters)
 382            {
 0383                if (((SslSecurityTokenParameters)p1).RequireClientCertificate != ((SslSecurityTokenParameters)p2).Requir
 0384                    return false;
 385            }
 0386            else if (p1 is SecureConversationSecurityTokenParameters)
 387            {
 0388                SecureConversationSecurityTokenParameters sc1 = (SecureConversationSecurityTokenParameters)p1;
 0389                SecureConversationSecurityTokenParameters sc2 = (SecureConversationSecurityTokenParameters)p2;
 390
 0391                if (sc1.RequireCancellation != sc2.RequireCancellation)
 0392                    return false;
 393
 0394                if (sc1.CanRenewSession != sc2.CanRenewSession)
 0395                    return false;
 396
 397
 0398                if (!AreBindingsMatching(sc1.BootstrapSecurityBindingElement, sc2.BootstrapSecurityBindingElement, exact
 0399                    return false;
 400            }
 0401            else if (p1 is IssuedSecurityTokenParameters)
 402            {
 0403                if (((IssuedSecurityTokenParameters)p1).KeyType != ((IssuedSecurityTokenParameters)p2).KeyType)
 0404                    return false;
 405            }
 406
 0407            return true;
 408        }
 409
 410        private static bool AreTokenParameterCollectionsMatching(Collection<SecurityTokenParameters> c1, Collection<Secu
 411        {
 0412            if (c1.Count != c2.Count)
 0413                return false;
 414
 0415            for (int i = 0; i < c1.Count; i++)
 0416                if (!AreTokenParametersMatching(c1[i], c2[i], true, exactMessageSecurityVersion))
 0417                    return false;
 418
 0419            return true;
 420        }
 421
 422        internal static bool AreBindingsMatching(SecurityBindingElement b1, SecurityBindingElement b2)
 423        {
 0424            return AreBindingsMatching(b1, b2, true);
 425        }
 426
 427        internal static bool AreBindingsMatching(SecurityBindingElement b1, SecurityBindingElement b2, bool exactMessage
 428        {
 0429            if (b1 == null || b2 == null)
 0430                return b1 == b2;
 431
 0432            if (b1.GetType() != b2.GetType())
 0433                return false;
 434
 0435            if (b1.MessageSecurityVersion != b2.MessageSecurityVersion)
 436            {
 437                // exactMessageSecurityVersion meant that BSP mismatch could be ignored
 0438                if (exactMessageSecurityVersion)
 0439                    return false;
 440
 0441                if (b1.MessageSecurityVersion.SecurityVersion != b2.MessageSecurityVersion.SecurityVersion
 0442                 || b1.MessageSecurityVersion.TrustVersion != b2.MessageSecurityVersion.TrustVersion
 0443                 || b1.MessageSecurityVersion.SecureConversationVersion != b2.MessageSecurityVersion.SecureConversationV
 0444                 || b1.MessageSecurityVersion.SecurityPolicyVersion != b2.MessageSecurityVersion.SecurityPolicyVersion)
 445                {
 0446                    return false;
 447                }
 448            }
 449
 0450            if (b1.SecurityHeaderLayout != b2.SecurityHeaderLayout)
 0451                return false;
 452
 0453            if (b1.DefaultAlgorithmSuite != b2.DefaultAlgorithmSuite)
 0454                return false;
 455
 0456            if (b1.IncludeTimestamp != b2.IncludeTimestamp)
 0457                return false;
 458
 0459            if (b1.SecurityHeaderLayout != b2.SecurityHeaderLayout)
 0460                return false;
 461
 0462            if (b1.KeyEntropyMode != b2.KeyEntropyMode)
 0463                return false;
 464
 0465            if (!AreTokenParameterCollectionsMatching(b1.EndpointSupportingTokenParameters.Endorsing, b2.EndpointSupport
 0466                return false;
 467
 0468            if (!AreTokenParameterCollectionsMatching(b1.EndpointSupportingTokenParameters.SignedEncrypted, b2.EndpointS
 0469                return false;
 470
 0471            if (!AreTokenParameterCollectionsMatching(b1.EndpointSupportingTokenParameters.Signed, b2.EndpointSupporting
 0472                return false;
 473
 0474            if (!AreTokenParameterCollectionsMatching(b1.EndpointSupportingTokenParameters.SignedEndorsing, b2.EndpointS
 0475                return false;
 476
 0477            if (b1.OperationSupportingTokenParameters.Count != b2.OperationSupportingTokenParameters.Count)
 0478                return false;
 479
 0480            foreach (KeyValuePair<string, SupportingTokenParameters> operation1 in b1.OperationSupportingTokenParameters
 481            {
 0482                if (!b2.OperationSupportingTokenParameters.ContainsKey(operation1.Key))
 0483                    return false;
 484
 0485                SupportingTokenParameters stp2 = b2.OperationSupportingTokenParameters[operation1.Key];
 486
 0487                if (!AreTokenParameterCollectionsMatching(operation1.Value.Endorsing, stp2.Endorsing, exactMessageSecuri
 0488                    return false;
 489
 0490                if (!AreTokenParameterCollectionsMatching(operation1.Value.SignedEncrypted, stp2.SignedEncrypted, exactM
 0491                    return false;
 492
 0493                if (!AreTokenParameterCollectionsMatching(operation1.Value.Signed, stp2.Signed, exactMessageSecurityVers
 0494                    return false;
 495
 0496                if (!AreTokenParameterCollectionsMatching(operation1.Value.SignedEndorsing, stp2.SignedEndorsing, exactM
 0497                    return false;
 498            }
 499
 0500            SymmetricSecurityBindingElement ssbe1 = b1 as SymmetricSecurityBindingElement;
 0501            if (ssbe1 != null)
 502            {
 0503                SymmetricSecurityBindingElement ssbe2 = (SymmetricSecurityBindingElement)b2;
 504
 0505                if (ssbe1.MessageProtectionOrder != ssbe2.MessageProtectionOrder)
 0506                    return false;
 507
 0508                if (!AreTokenParametersMatching(ssbe1.ProtectionTokenParameters, ssbe2.ProtectionTokenParameters, false,
 0509                    return false;
 510            }
 511
 512            //TODO If AsymmetricKey is supported
 513            //AsymmetricSecurityBindingElement asbe1 = b1 as AsymmetricSecurityBindingElement;
 514            //if (asbe1 != null)
 515            //{
 516            //    AsymmetricSecurityBindingElement asbe2 = (AsymmetricSecurityBindingElement)b2;
 517
 518            //    if (asbe1.MessageProtectionOrder != asbe2.MessageProtectionOrder)
 519            //        return false;
 520
 521            //    if (asbe1.RequireSignatureConfirmation != asbe2.RequireSignatureConfirmation)
 522            //        return false;
 523
 524            //    if (!AreTokenParametersMatching(asbe1.InitiatorTokenParameters, asbe2.InitiatorTokenParameters, true, 
 525            //        || !AreTokenParametersMatching(asbe1.RecipientTokenParameters, asbe2.RecipientTokenParameters, tru
 526            //        return false;
 527            //}
 528
 0529            return true;
 0530        }
 531
 532        protected virtual void AddBindingTemplates(Dictionary<AuthenticationMode, SecurityBindingElement> bindingTemplat
 533        {
 534            //TODO As Authentication Modes are added
 535            //AddBindingTemplate(bindingTemplates, AuthenticationMode.AnonymousForCertificate);
 536            //AddBindingTemplate(bindingTemplates, AuthenticationMode.AnonymousForSslNegotiated);
 0537            AddBindingTemplate(bindingTemplates, AuthenticationMode.CertificateOverTransport);
 538            //if (_templateKeyType == SecurityKeyType.SymmetricKey)
 539            //{
 540            //    AddBindingTemplate(bindingTemplates, AuthenticationMode.IssuedToken);
 541            //}
 542            //AddBindingTemplate(bindingTemplates, AuthenticationMode.IssuedTokenForCertificate);
 543            //AddBindingTemplate(bindingTemplates, AuthenticationMode.IssuedTokenForSslNegotiated);
 544            //AddBindingTemplate(bindingTemplates, AuthenticationMode.IssuedTokenOverTransport);
 545            //AddBindingTemplate(bindingTemplates, AuthenticationMode.Kerberos);
 546            //AddBindingTemplate(bindingTemplates, AuthenticationMode.KerberosOverTransport);
 547            //AddBindingTemplate(bindingTemplates, AuthenticationMode.MutualCertificate);
 548            //AddBindingTemplate(bindingTemplates, AuthenticationMode.MutualCertificateDuplex);
 549            //AddBindingTemplate(bindingTemplates, AuthenticationMode.MutualSslNegotiated);
 550            //AddBindingTemplate(bindingTemplates, AuthenticationMode.SspiNegotiated);
 551            //AddBindingTemplate(bindingTemplates, AuthenticationMode.UserNameForCertificate);
 552            //AddBindingTemplate(bindingTemplates, AuthenticationMode.UserNameForSslNegotiated);
 0553            AddBindingTemplate(bindingTemplates, AuthenticationMode.UserNameOverTransport);
 0554            AddBindingTemplate(bindingTemplates, AuthenticationMode.SspiNegotiatedOverTransport);
 0555        }
 556
 557        private bool TryInitializeAuthenticationMode(SecurityBindingElement sbe)
 558        {
 559            bool result;
 560
 0561            if (sbe.OperationSupportingTokenParameters.Count > 0)
 0562                result = false;
 563            else
 564            {
 0565                SetIssuedTokenKeyType(sbe);
 566
 0567                Dictionary<AuthenticationMode, SecurityBindingElement> bindingTemplates = new Dictionary<AuthenticationM
 0568                AddBindingTemplates(bindingTemplates);
 569
 0570                result = false;
 0571                foreach (AuthenticationMode mode in bindingTemplates.Keys)
 572                {
 0573                    SecurityBindingElement candidate = bindingTemplates[mode];
 0574                    if (AreBindingsMatching(sbe, candidate))
 575                    {
 0576                        AuthenticationMode = mode;
 0577                        result = true;
 0578                        break;
 579                    }
 580                }
 581            }
 582
 0583            return result;
 584        }
 585
 586        private void SetIssuedTokenKeyType(SecurityBindingElement sbe)
 587        {
 588            // Set the keyType for building the template for IssuedToken binding.
 589            // The reason is the different supporting token is defined depending on keyType.
 0590            if (sbe.EndpointSupportingTokenParameters.Endorsing.Count > 0 &&
 0591                sbe.EndpointSupportingTokenParameters.Endorsing[0] is IssuedSecurityTokenParameters)
 592            {
 0593                _templateKeyType = ((IssuedSecurityTokenParameters)sbe.EndpointSupportingTokenParameters.Endorsing[0]).K
 594            }
 0595            else if (sbe.EndpointSupportingTokenParameters.Signed.Count > 0 &&
 0596                sbe.EndpointSupportingTokenParameters.Signed[0] is IssuedSecurityTokenParameters)
 597            {
 0598                _templateKeyType = ((IssuedSecurityTokenParameters)sbe.EndpointSupportingTokenParameters.Signed[0]).KeyT
 599            }
 0600            else if (sbe.EndpointSupportingTokenParameters.SignedEncrypted.Count > 0 &&
 0601                sbe.EndpointSupportingTokenParameters.SignedEncrypted[0] is IssuedSecurityTokenParameters)
 602            {
 0603                _templateKeyType = ((IssuedSecurityTokenParameters)sbe.EndpointSupportingTokenParameters.SignedEncrypted
 604            }
 605            else
 606            {
 0607                _templateKeyType = SecurityBindingDefaults.DefaultKeyType;
 608            }
 0609        }
 610
 611        protected virtual void InitializeNestedTokenParameterSettings(SecurityTokenParameters sp, bool initializeNestedB
 612        {
 0613            if (sp is SspiSecurityTokenParameters)
 0614                SetPropertyValueIfNotDefaultValue(ConfigurationStrings.RequireSecurityContextCancellation, ((SspiSecurit
 0615            else if (sp is SslSecurityTokenParameters)
 0616                SetPropertyValueIfNotDefaultValue(ConfigurationStrings.RequireSecurityContextCancellation, ((SslSecurity
 617            //TODO: Implement IssuedTokenParameters
 618            //else if (sp is IssuedSecurityTokenParameters)
 619            //    this.IssuedTokenParameters.InitializeFrom((IssuedSecurityTokenParameters)sp, initializeNestedBindings)
 0620        }
 621
 622        internal void InitializeFrom(BindingElement bindingElement, bool initializeNestedBindings)
 623        {
 0624            if (bindingElement == null)
 625            {
 0626                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(bindingElement));
 627            }
 0628            SecurityBindingElement sbe = (SecurityBindingElement)bindingElement;
 629
 630            // Can't apply default value optimization to properties like DefaultAlgorithmSuite because the defaults are 
 0631            DefaultAlgorithmSuite = sbe.DefaultAlgorithmSuite;
 0632            IncludeTimestamp = sbe.IncludeTimestamp;
 0633            if (sbe.MessageSecurityVersion != MessageSecurityVersion.Default)
 634            {
 0635                MessageSecurityVersion = sbe.MessageSecurityVersion;
 636            }
 637            // Still safe to apply the optimization here because the runtime defaults are the same as config defaults in
 0638            SetPropertyValueIfNotDefaultValue(ConfigurationStrings.KeyEntropyMode, sbe.KeyEntropyMode);
 0639            SetPropertyValueIfNotDefaultValue(ConfigurationStrings.SecurityHeaderLayout, sbe.SecurityHeaderLayout);
 0640            SetPropertyValueIfNotDefaultValue(ConfigurationStrings.ProtectTokens, sbe.ProtectTokens);
 0641            SetPropertyValueIfNotDefaultValue(ConfigurationStrings.AllowInsecureTransport, sbe.AllowInsecureTransport);
 0642            SetPropertyValueIfNotDefaultValue(ConfigurationStrings.EnableUnsecuredResponse, sbe.EnableUnsecuredResponse)
 643
 644
 0645            bool? requireDerivedKeys = new bool?();
 646
 0647            if (sbe.EndpointSupportingTokenParameters.Endorsing.Count == 1)
 648            {
 0649                InitializeNestedTokenParameterSettings(sbe.EndpointSupportingTokenParameters.Endorsing[0], initializeNes
 650            }
 0651            else if (sbe.EndpointSupportingTokenParameters.SignedEncrypted.Count == 1)
 652            {
 0653                InitializeNestedTokenParameterSettings(sbe.EndpointSupportingTokenParameters.SignedEncrypted[0], initial
 654            }
 0655            else if (sbe.EndpointSupportingTokenParameters.Signed.Count == 1)
 656            {
 0657                InitializeNestedTokenParameterSettings(sbe.EndpointSupportingTokenParameters.Signed[0], initializeNested
 658            }
 659
 0660            bool initializationFailure = false;
 661
 0662            foreach (SecurityTokenParameters t in sbe.EndpointSupportingTokenParameters.Endorsing)
 663            {
 664                //if (t.HasAsymmetricKey == false)//TODO If AsymmetricKey is supported
 665                {
 0666                    if (requireDerivedKeys.HasValue && requireDerivedKeys.Value != t.RequireDerivedKeys)
 0667                        initializationFailure = true;
 668                    else
 0669                        requireDerivedKeys = t.RequireDerivedKeys;
 670                }
 671            }
 672
 0673            SymmetricSecurityBindingElement ssbe = sbe as SymmetricSecurityBindingElement;
 0674            if (ssbe != null)
 675            {
 0676                SetPropertyValueIfNotDefaultValue(ConfigurationStrings.MessageProtectionOrder, ssbe.MessageProtectionOrd
 0677                RequireSignatureConfirmation = ssbe.RequireSignatureConfirmation;
 0678                if (ssbe.ProtectionTokenParameters != null)
 679                {
 0680                    InitializeNestedTokenParameterSettings(ssbe.ProtectionTokenParameters, initializeNestedBindings);
 0681                    if (requireDerivedKeys.HasValue && requireDerivedKeys.Value != ssbe.ProtectionTokenParameters.Requir
 0682                        initializationFailure = true;
 683                    else
 0684                        requireDerivedKeys = ssbe.ProtectionTokenParameters.RequireDerivedKeys;
 685                }
 686            }
 687            else
 688            {
 689                //TODO If AsymmetricKey is supported
 690                //AsymmetricSecurityBindingElement asbe = sbe as AsymmetricSecurityBindingElement;
 691                //if (asbe != null)
 692                //{
 693                //    SetPropertyValueIfNotDefaultValue(ConfigurationStrings.MessageProtectionOrder, asbe.MessageProtect
 694                //    this.RequireSignatureConfirmation = asbe.RequireSignatureConfirmation;
 695                //    if (asbe.InitiatorTokenParameters != null)
 696                //    {
 697                //        this.InitializeNestedTokenParameterSettings(asbe.InitiatorTokenParameters, initializeNestedBin
 698
 699                //        //
 700                //        // Copy the derived key token bool flag from the token parameters. The token parameter was set
 701                //        // importing WSDL during SecurityBindingElementImporter.ImportPolicy time
 702                //        //
 703                //        if (requireDerivedKeys.HasValue && requireDerivedKeys.Value != asbe.InitiatorTokenParameters.R
 704                //            initializationFailure = true;
 705                //        else
 706                //            requireDerivedKeys = asbe.InitiatorTokenParameters.RequireDerivedKeys;
 707                //    }
 708                //}
 709            }
 710
 0711            _willX509IssuerReferenceAssertionBeWritten = DoesSecurityBindingElementContainClauseTypeofIssuerSerial(sbe);
 0712            RequireDerivedKeys = requireDerivedKeys.GetValueOrDefault(SecurityBindingDefaults.DefaultRequireDerivedKeys)
 0713            LocalServiceSettings.InitializeFrom(sbe.LocalServiceSettings);
 714
 0715            if (!initializationFailure)
 0716                initializationFailure = !TryInitializeAuthenticationMode(sbe);
 717
 0718            if (initializationFailure)
 0719                _failedSecurityBindingElement = sbe;
 0720        }
 721
 722        protected internal override void InitializeFrom(BindingElement bindingElement)
 723        {
 0724            InitializeFrom(bindingElement, true);
 0725        }
 726
 727        /// <summary>
 728        /// returns true if one of the xxxSupportingTokenParameters.yyy is of type IssuerSerial
 729        /// </summary>
 730        /// <param name="sbe"></param>
 731        /// <returns></returns>
 732        private bool DoesSecurityBindingElementContainClauseTypeofIssuerSerial(SecurityBindingElement sbe)
 733        {
 0734            if (sbe == null)
 0735                return false;
 736
 0737            if (sbe is SymmetricSecurityBindingElement)
 738            {
 0739                X509SecurityTokenParameters tokenParamameters = ((SymmetricSecurityBindingElement)sbe).ProtectionTokenPa
 0740                if (tokenParamameters != null && tokenParamameters.X509ReferenceStyle == X509KeyIdentifierClauseType.Iss
 0741                    return true;
 742            }
 743            //TODO if AsymmetricSecurityBindingElement is added
 744            //else if (sbe is AsymmetricSecurityBindingElement)
 745            //{
 746            //    X509SecurityTokenParameters initiatorParamameters = ((AsymmetricSecurityBindingElement)sbe).InitiatorT
 747            //    if (initiatorParamameters != null && initiatorParamameters.X509ReferenceStyle == X509KeyIdentifierClau
 748            //        return true;
 749
 750            //    X509SecurityTokenParameters recepientParamameters = ((AsymmetricSecurityBindingElement)sbe).RecipientT
 751            //    if (recepientParamameters != null && recepientParamameters.X509ReferenceStyle == X509KeyIdentifierClau
 752            //        return true;
 753            //}
 754
 0755            if (DoesX509TokenParametersContainClauseTypeofIssuerSerial(sbe.EndpointSupportingTokenParameters.Endorsing))
 0756                return true;
 757
 0758            if (DoesX509TokenParametersContainClauseTypeofIssuerSerial(sbe.EndpointSupportingTokenParameters.Signed))
 0759                return true;
 760
 0761            if (DoesX509TokenParametersContainClauseTypeofIssuerSerial(sbe.EndpointSupportingTokenParameters.SignedEncry
 0762                return true;
 763
 0764            if (DoesX509TokenParametersContainClauseTypeofIssuerSerial(sbe.EndpointSupportingTokenParameters.SignedEndor
 0765                return true;
 766
 0767            if (DoesX509TokenParametersContainClauseTypeofIssuerSerial(sbe.OptionalEndpointSupportingTokenParameters.End
 0768                return true;
 769
 0770            if (DoesX509TokenParametersContainClauseTypeofIssuerSerial(sbe.OptionalEndpointSupportingTokenParameters.Sig
 0771                return true;
 772
 0773            if (DoesX509TokenParametersContainClauseTypeofIssuerSerial(sbe.OptionalEndpointSupportingTokenParameters.Sig
 0774                return true;
 775
 0776            if (DoesX509TokenParametersContainClauseTypeofIssuerSerial(sbe.OptionalEndpointSupportingTokenParameters.Sig
 0777                return true;
 778
 0779            return false;
 780        }
 781
 782        private bool DoesX509TokenParametersContainClauseTypeofIssuerSerial(Collection<SecurityTokenParameters> tokenPar
 783        {
 0784            foreach (SecurityTokenParameters tokenParameter in tokenParameters)
 785            {
 0786                X509SecurityTokenParameters x509TokenParameter = tokenParameter as X509SecurityTokenParameters;
 0787                if (x509TokenParameter != null)
 788                {
 0789                    if (x509TokenParameter.X509ReferenceStyle == X509KeyIdentifierClauseType.IssuerSerial)
 0790                        return true;
 791                }
 792            }
 793
 0794            return false;
 0795        }
 796
 797        protected override bool SerializeToXmlElement(XmlWriter writer, String elementName)
 798        {
 799            bool result;
 800
 0801            if (_failedSecurityBindingElement != null && writer != null)
 802            {
 0803                writer.WriteComment(SR.Format(SR.ConfigurationSchemaInsuffientForSecurityBindingElementInstance));
 0804                writer.WriteComment(_failedSecurityBindingElement.ToString());
 0805                result = true;
 806            }
 807            else
 808            {
 0809                if (writer != null && _willX509IssuerReferenceAssertionBeWritten)
 0810                    writer.WriteComment(SR.Format(SR.ConfigurationSchemaContainsX509IssuerSerialReference));
 811
 0812                result = base.SerializeToXmlElement(writer, elementName);
 813            }
 814
 0815            return result;
 816        }
 817
 818        protected override bool SerializeElement(XmlWriter writer, bool serializeCollectionKey)
 819        {
 0820            bool nontrivial = base.SerializeElement(writer, serializeCollectionKey);
 821
 822            // A SecurityElement can copy properties from a "bootstrap" SecurityBaseElement.
 823            // In this case, a trivial bootstrap (no properties set) is equivalent to not having one at all so we can om
 0824            Func<PropertyInformation, bool> nontrivialProperty = property => property.ValueOrigin == PropertyValueOrigin
 0825            if (IsSecurityElementBootstrap && !ElementInformation.Properties.OfType<PropertyInformation>().Any(nontrivia
 826            {
 0827                nontrivial = false;
 828            }
 0829            return nontrivial;
 830        }
 831
 832
 833        protected override void Unmerge(ConfigurationElement sourceElement, ConfigurationElement parentElement, Configur
 834        {
 0835            if (sourceElement is SecurityElementBase)
 836            {
 0837                _failedSecurityBindingElement = ((SecurityElementBase)sourceElement)._failedSecurityBindingElement;
 0838                _willX509IssuerReferenceAssertionBeWritten = ((SecurityElementBase)sourceElement)._willX509IssuerReferen
 839            }
 840
 0841            base.Unmerge(sourceElement, parentElement, saveMode);
 0842        }
 843    }
 844}

Methods/Properties

.ctor()
HasImportFailed()
IsSecurityElementBootstrap()
DefaultAlgorithmSuite()
DefaultAlgorithmSuite(CoreWCF.Security.SecurityAlgorithmSuite)
EnableUnsecuredResponse()
EnableUnsecuredResponse(System.Boolean)
AuthenticationMode()
AuthenticationMode(CoreWCF.Configuration.AuthenticationMode)
BindingElementType()
RequireDerivedKeys()
RequireDerivedKeys(System.Boolean)
SecurityHeaderLayout()
SecurityHeaderLayout(CoreWCF.Channels.SecurityHeaderLayout)
IncludeTimestamp()
IncludeTimestamp(System.Boolean)
AllowInsecureTransport()
AllowInsecureTransport(System.Boolean)
KeyEntropyMode()
KeyEntropyMode(CoreWCF.Security.SecurityKeyEntropyMode)
IssuedTokenParameters()
LocalServiceSettings()
MessageProtectionOrder()
MessageProtectionOrder(CoreWCF.Security.MessageProtectionOrder)
ProtectTokens()
ProtectTokens(System.Boolean)
MessageSecurityVersion()
MessageSecurityVersion(CoreWCF.MessageSecurityVersion)
RequireSecurityContextCancellation()
RequireSecurityContextCancellation(System.Boolean)
RequireSignatureConfirmation()
RequireSignatureConfirmation(System.Boolean)
CanRenewSecurityContextToken()
CanRenewSecurityContextToken(System.Boolean)
ApplyConfiguration(CoreWCF.Channels.BindingElement)
CopyFrom(CoreWCF.Configuration.ServiceModelExtensionElement)
CreateBindingElement()
CreateBindingElement(System.Boolean)
AddBindingTemplate(System.Collections.Generic.Dictionary`2<CoreWCF.Configuration.AuthenticationMode,CoreWCF.Channels.SecurityBindingElement>,CoreWCF.Configuration.AuthenticationMode)
AreTokenParametersMatching(CoreWCF.Security.Tokens.SecurityTokenParameters,CoreWCF.Security.Tokens.SecurityTokenParameters,System.Boolean,System.Boolean)
AreTokenParameterCollectionsMatching(System.Collections.ObjectModel.Collection`1<CoreWCF.Security.Tokens.SecurityTokenParameters>,System.Collections.ObjectModel.Collection`1<CoreWCF.Security.Tokens.SecurityTokenParameters>,System.Boolean)
AreBindingsMatching(CoreWCF.Channels.SecurityBindingElement,CoreWCF.Channels.SecurityBindingElement)
AreBindingsMatching(CoreWCF.Channels.SecurityBindingElement,CoreWCF.Channels.SecurityBindingElement,System.Boolean)
AddBindingTemplates(System.Collections.Generic.Dictionary`2<CoreWCF.Configuration.AuthenticationMode,CoreWCF.Channels.SecurityBindingElement>)
TryInitializeAuthenticationMode(CoreWCF.Channels.SecurityBindingElement)
SetIssuedTokenKeyType(CoreWCF.Channels.SecurityBindingElement)
InitializeNestedTokenParameterSettings(CoreWCF.Security.Tokens.SecurityTokenParameters,System.Boolean)
InitializeFrom(CoreWCF.Channels.BindingElement,System.Boolean)
InitializeFrom(CoreWCF.Channels.BindingElement)
DoesSecurityBindingElementContainClauseTypeofIssuerSerial(CoreWCF.Channels.SecurityBindingElement)
DoesX509TokenParametersContainClauseTypeofIssuerSerial(System.Collections.ObjectModel.Collection`1<CoreWCF.Security.Tokens.SecurityTokenParameters>)
SerializeToXmlElement(System.Xml.XmlWriter,System.String)
SerializeElement(System.Xml.XmlWriter,System.Boolean)
Unmerge(System.Configuration.ConfigurationElement,System.Configuration.ConfigurationElement,System.Configuration.ConfigurationSaveMode)