internal PeerCredential(PeerCredential other)
 {
     this.certificate                 = other.certificate;
     this.meshPassword                = other.meshPassword;
     this.peerAuthentication          = new X509PeerCertificateAuthentication(other.peerAuthentication);
     this.messageSenderAuthentication = new X509PeerCertificateAuthentication(other.messageSenderAuthentication);
     this.isReadOnly = other.isReadOnly;
 }
예제 #2
0
 internal PeerCredential(PeerCredential other)
 {
     this.certificate = other.certificate;
     this.meshPassword = other.meshPassword;
     this.peerAuthentication = new X509PeerCertificateAuthentication(other.peerAuthentication);
     this.messageSenderAuthentication = new X509PeerCertificateAuthentication(other.messageSenderAuthentication);
     this.isReadOnly = other.isReadOnly;
 }
 internal X509PeerCertificateAuthentication(X509PeerCertificateAuthentication other)
 {
     this.certificateValidationMode  = other.certificateValidationMode;
     this.customCertificateValidator = other.customCertificateValidator;
     this.revocationMode             = other.revocationMode;
     this.trustedStoreLocation       = other.trustedStoreLocation;
     this.isReadOnly = other.isReadOnly;
 }
 internal X509PeerCertificateAuthentication(X509PeerCertificateAuthentication other)
 {
     this.certificateValidationMode = other.certificateValidationMode;
     this.customCertificateValidator = other.customCertificateValidator;
     this.revocationMode = other.revocationMode;
     this.trustedStoreLocation = other.trustedStoreLocation;
     this.isReadOnly = other.isReadOnly;
 }
 internal X509PeerCertificateAuthentication(X509PeerCertificateAuthentication other)
 {
     this.certificateValidationMode = X509CertificateValidationMode.PeerOrChainTrust;
     this.revocationMode = X509RevocationMode.Online;
     this.trustedStoreLocation = StoreLocation.CurrentUser;
     this.certificateValidationMode = other.certificateValidationMode;
     this.customCertificateValidator = other.customCertificateValidator;
     this.revocationMode = other.revocationMode;
     this.trustedStoreLocation = other.trustedStoreLocation;
     this.isReadOnly = other.isReadOnly;
 }
예제 #6
0
 internal X509PeerCertificateAuthentication(X509PeerCertificateAuthentication other)
 {
     this.certificateValidationMode  = X509CertificateValidationMode.PeerOrChainTrust;
     this.revocationMode             = X509RevocationMode.Online;
     this.trustedStoreLocation       = StoreLocation.CurrentUser;
     this.certificateValidationMode  = other.certificateValidationMode;
     this.customCertificateValidator = other.customCertificateValidator;
     this.revocationMode             = other.revocationMode;
     this.trustedStoreLocation       = other.trustedStoreLocation;
     this.isReadOnly = other.isReadOnly;
 }
        private bool SameAuthenticators(X509PeerCertificateAuthentication one, X509PeerCertificateAuthentication two)
        {
            if (one.CertificateValidationMode != two.CertificateValidationMode)
            {
                return(false);
            }
            if (one.CertificateValidationMode != X509CertificateValidationMode.Custom)
            {
                return(one.GetType().Equals(two.GetType()));
            }
            X509CertificateValidator validator  = null;
            X509CertificateValidator validator2 = null;

            one.TryGetCertificateValidator(out validator);
            two.TryGetCertificateValidator(out validator2);
            return(((validator != null) && (validator2 != null)) && validator.Equals(validator2));
        }
예제 #8
0
 bool SameAuthenticators(X509PeerCertificateAuthentication one, X509PeerCertificateAuthentication two)
 {
     if (one.CertificateValidationMode != two.CertificateValidationMode)
     {
         return(false);
     }
     if (one.CertificateValidationMode != X509CertificateValidationMode.Custom)
     {
         return(one.GetType().Equals(two.GetType()));
     }
     else
     {
         System.IdentityModel.Selectors.X509CertificateValidator first = null, second = null;
         one.TryGetCertificateValidator(out first);
         two.TryGetCertificateValidator(out second);
         return(first != null && second != null && first.Equals(second));
     }
 }
 internal void ApplyConfiguration(X509PeerCertificateAuthentication cert)
 {
     if (cert == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("cert");
     }
     cert.CertificateValidationMode = this.CertificateValidationMode;
     cert.RevocationMode = this.RevocationMode;
     cert.TrustedStoreLocation = this.TrustedStoreLocation;
     if (!string.IsNullOrEmpty(this.CustomCertificateValidatorType))
     {
         Type c = Type.GetType(this.CustomCertificateValidatorType, true);
         if (!typeof(X509CertificateValidator).IsAssignableFrom(c))
         {
             throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ConfigurationErrorsException(System.ServiceModel.SR.GetString("ConfigInvalidCertificateValidatorType", new object[] { this.CustomCertificateValidatorType, typeof(X509CertificateValidator).ToString() })));
         }
         cert.CustomCertificateValidator = (X509CertificateValidator) Activator.CreateInstance(c);
     }
 }
 internal PeerCredential()
 {
     this.peerAuthentication          = new X509PeerCertificateAuthentication();
     this.messageSenderAuthentication = new X509PeerCertificateAuthentication();
 }
예제 #11
0
 internal PeerCredential()
 {
     peerAuthentication = new X509PeerCertificateAuthentication();
     messageSenderAuthentication = new X509PeerCertificateAuthentication();
 }
예제 #12
0
 bool SameAuthenticators(X509PeerCertificateAuthentication one, X509PeerCertificateAuthentication two)
 {
     if (one.CertificateValidationMode != two.CertificateValidationMode)
         return false;
     if (one.CertificateValidationMode != X509CertificateValidationMode.Custom)
     {
         return (one.GetType().Equals(two.GetType()));
     }
     else
     {
         System.IdentityModel.Selectors.X509CertificateValidator first = null, second = null;
         one.TryGetCertificateValidator(out first);
         two.TryGetCertificateValidator(out second);
         return (first != null && second != null && first.Equals(second));
     }
 }
 private bool SameAuthenticators(X509PeerCertificateAuthentication one, X509PeerCertificateAuthentication two)
 {
     if (one.CertificateValidationMode != two.CertificateValidationMode)
     {
         return false;
     }
     if (one.CertificateValidationMode != X509CertificateValidationMode.Custom)
     {
         return one.GetType().Equals(two.GetType());
     }
     X509CertificateValidator validator = null;
     X509CertificateValidator validator2 = null;
     one.TryGetCertificateValidator(out validator);
     two.TryGetCertificateValidator(out validator2);
     return (((validator != null) && (validator2 != null)) && validator.Equals(validator2));
 }