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));
        }
示例#2
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));
     }
 }
 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));
 }