public static bool ThreadSafeBaseValidateCertificate(RequestDigestSet requestDigestSet, X509Certificate certificate, SslPolicyErrors sslPolicyError)
 {
     if (certificate != null)
     {
         DigestSet digestSet   = new DigestSet();
         byte[]    rawCertData = certificate.GetRawCertData();
         digestSet.setSha1(DigestHelper.sha1(rawCertData));
         digestSet.setSha256(DigestHelper.sha256(rawCertData));
         requestDigestSet.CertificateDigest = digestSet;
         digestSet   = new DigestSet();
         rawCertData = certificate.GetPublicKey();
         digestSet.setSha1(DigestHelper.sha1(rawCertData));
         digestSet.setSha256(DigestHelper.sha256(rawCertData));
         requestDigestSet.SubjectDigest = digestSet;
         return(true);
     }
     return(false);
 }
Beispiel #2
0
 public virtual bool validateCertificate(X509Certificate certificate, SslPolicyErrors sslPolicyError)
 {
     if (certificate != null)
     {
         DigestSet digestSet   = new DigestSet();
         byte[]    rawCertData = certificate.GetRawCertData();
         digestSet.setSha1(DigestHelper.sha1(rawCertData));
         digestSet.setSha256(DigestHelper.sha256(rawCertData));
         setCertificateDigest(digestSet);
         digestSet   = new DigestSet();
         rawCertData = certificate.GetPublicKey();
         digestSet.setSha1(DigestHelper.sha1(rawCertData));
         digestSet.setSha256(DigestHelper.sha256(rawCertData));
         setSubjectDigest(digestSet);
         return(true);
     }
     return(false);
 }