Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / net / cert / x509_certificate.h
index 97906ed..5c64a44 100644 (file)
 
 #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;
@@ -395,6 +394,10 @@ class NET_EXPORT X509Certificate
   // 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.
   //
@@ -421,6 +424,9 @@ class NET_EXPORT X509Certificate
       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