Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Unified Diff: net/cert/x509_certificate.h

Issue 2610903003: [refactor] Extract the CertVerifyResult assignment of has_md2, has_md4, (Closed)
Patch Set: address comments Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/cert/cert_verify_proc_win.cc ('k') | net/cert/x509_certificate_ios.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/x509_certificate.h
diff --git a/net/cert/x509_certificate.h b/net/cert/x509_certificate.h
index 613bd09509004301c7d4f4e72d6704733df5c717..138192c7c1c9aa560e80821d3b4989541d52ed13 100644
--- a/net/cert/x509_certificate.h
+++ b/net/cert/x509_certificate.h
@@ -80,6 +80,14 @@ class NET_EXPORT X509Certificate
kPublicKeyTypeECDH
};
+ enum SignatureHashAlgorithm {
+ kSignatureHashAlgorithmMd2,
+ kSignatureHashAlgorithmMd4,
+ kSignatureHashAlgorithmMd5,
+ kSignatureHashAlgorithmSha1,
+ kSignatureHashAlgorithmOther,
+ };
+
enum Format {
// The data contains a single DER-encoded certificate, or a PEM-encoded
// DER certificate with the PEM encoding block name of "CERTIFICATE".
@@ -327,6 +335,15 @@ class NET_EXPORT X509Certificate
size_t* size_bits,
PublicKeyType* type);
+ // Returns the digest algorithm used in |cert_handle|'s signature.
+ // If the digest algorithm cannot be determined, or if it is not one
+ // of the explicitly enumerated values, kSignatureHashAlgorithmOther
+ // will be returned.
+ // NOTE: No validation of the signature is performed, and thus invalid
+ // signatures may result in seemingly meaningful values.
+ static SignatureHashAlgorithm GetSignatureHashAlgorithm(
+ OSCertHandle cert_handle);
+
// Returns the OSCertHandle of this object. Because of caching, this may
// differ from the OSCertHandle originally supplied during initialization.
// Note: On Windows, CryptoAPI may return unexpected results if this handle
« no previous file with comments | « net/cert/cert_verify_proc_win.cc ('k') | net/cert/x509_certificate_ios.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698