internal void ApplyConfiguration(X509CertificateRecipientClientCredential cert)
        {
            if (cert == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("cert");
            }

            PropertyInformationCollection propertyInfo = this.ElementInformation.Properties;

            if (propertyInfo[ConfigurationStrings.Authentication].ValueOrigin != PropertyValueOrigin.Default)
            {
                this.Authentication.ApplyConfiguration(cert.Authentication);
            }

            if (propertyInfo[ConfigurationStrings.SslCertificateAuthentication].ValueOrigin != PropertyValueOrigin.Default)
            {
                cert.SslCertificateAuthentication = new X509ServiceCertificateAuthentication();
                this.SslCertificateAuthentication.ApplyConfiguration(cert.SslCertificateAuthentication);
            }

            this.DefaultCertificate.ApplyConfiguration(cert);

            X509ScopedServiceCertificateElementCollection scopedCertificates = this.ScopedCertificates;

            for (int i = 0; i < scopedCertificates.Count; ++i)
            {
                scopedCertificates[i].ApplyConfiguration(cert);
            }
        }
        public void Copy(X509RecipientCertificateClientElement from)
        {
            if (this.IsReadOnly())
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ConfigurationErrorsException(SR.GetString(SR.ConfigReadOnly)));
            }
            if (null == from)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("from");
            }

            this.DefaultCertificate.Copy(from.DefaultCertificate);

            X509ScopedServiceCertificateElementCollection srcScopedCertificates = from.ScopedCertificates;
            X509ScopedServiceCertificateElementCollection dstScopedCertificates = this.ScopedCertificates;

            dstScopedCertificates.Clear();
            for (int i = 0; i < srcScopedCertificates.Count; ++i)
            {
                dstScopedCertificates.Add(srcScopedCertificates[i]);
            }

            this.Authentication.Copy(from.Authentication);
            this.SslCertificateAuthentication.Copy(from.SslCertificateAuthentication);
        }
Exemple #3
0
        internal void ApplyConfiguration(X509CertificateRecipientClientCredential cert)
        {
            if (cert == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("cert");
            }
            if (base.ElementInformation.Properties["authentication"].ValueOrigin != PropertyValueOrigin.Default)
            {
                this.Authentication.ApplyConfiguration(cert.Authentication);
            }
            this.DefaultCertificate.ApplyConfiguration(cert);
            X509ScopedServiceCertificateElementCollection scopedCertificates = this.ScopedCertificates;

            for (int i = 0; i < scopedCertificates.Count; i++)
            {
                scopedCertificates[i].ApplyConfiguration(cert);
            }
        }
Exemple #4
0
        public void Copy(X509RecipientCertificateClientElement from)
        {
            if (this.IsReadOnly())
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ConfigurationErrorsException(System.ServiceModel.SR.GetString("ConfigReadOnly")));
            }
            if (from == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("from");
            }
            this.DefaultCertificate.Copy(from.DefaultCertificate);
            X509ScopedServiceCertificateElementCollection scopedCertificates = from.ScopedCertificates;
            X509ScopedServiceCertificateElementCollection elements2          = this.ScopedCertificates;

            elements2.Clear();
            for (int i = 0; i < scopedCertificates.Count; i++)
            {
                elements2.Add(scopedCertificates[i]);
            }
            this.Authentication.Copy(from.Authentication);
        }