#if defined(OS_WIN)
#include <windows.h>
-#include <wincrypt.h>
+#include "crypto/wincrypt_shim.h"
#elif defined(OS_MACOSX)
#include <CoreFoundation/CFArray.h>
#include <Security/SecBase.h>
-
#elif defined(USE_OPENSSL_CERTS)
// Forward declaration; real one in <x509.h>
typedef struct x509_st X509;
// the same.
static SHA1HashValue CalculateFingerprint(OSCertHandle cert_handle);
+ // Calculates the SHA-256 fingerprint of the certificate. Returns an empty
+ // (all zero) fingerprint on failure.
+ static SHA256HashValue CalculateFingerprint256(OSCertHandle cert_handle);
+
// Calculates the SHA-1 fingerprint of the intermediate CA certificates.
// Returns an empty (all zero) fingerprint on failure.
//
OSCertHandle leaf,
const OSCertHandles& intermediates);
+ // Returns true if the certificate is self-signed.
+ static bool IsSelfSigned(OSCertHandle cert_handle);
+
private:
friend class base::RefCountedThreadSafe<X509Certificate>;
friend class TestRootCerts; // For unit tests