| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_CERT_X509_CERTIFICATE_H_ | 5 #ifndef NET_CERT_X509_CERTIFICATE_H_ |
| 6 #define NET_CERT_X509_CERTIFICATE_H_ | 6 #define NET_CERT_X509_CERTIFICATE_H_ |
| 7 | 7 |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 static void FreeOSCertHandle(OSCertHandle cert_handle); | 388 static void FreeOSCertHandle(OSCertHandle cert_handle); |
| 389 | 389 |
| 390 // Calculates the SHA-1 fingerprint of the certificate. Returns an empty | 390 // Calculates the SHA-1 fingerprint of the certificate. Returns an empty |
| 391 // (all zero) fingerprint on failure. | 391 // (all zero) fingerprint on failure. |
| 392 // | 392 // |
| 393 // For calculating fingerprints, prefer SHA-1 for performance when indexing, | 393 // For calculating fingerprints, prefer SHA-1 for performance when indexing, |
| 394 // but callers should use IsSameOSCert() before assuming two certificates are | 394 // but callers should use IsSameOSCert() before assuming two certificates are |
| 395 // the same. | 395 // the same. |
| 396 static SHA1HashValue CalculateFingerprint(OSCertHandle cert_handle); | 396 static SHA1HashValue CalculateFingerprint(OSCertHandle cert_handle); |
| 397 | 397 |
| 398 // Calculates the SHA-256 fingerprint of the certificate. Returns an empty |
| 399 // (all zero) fingerprint on failure. |
| 400 static SHA256HashValue CalculateFingerprint256(OSCertHandle cert_handle); |
| 401 |
| 398 // Calculates the SHA-1 fingerprint of the intermediate CA certificates. | 402 // Calculates the SHA-1 fingerprint of the intermediate CA certificates. |
| 399 // Returns an empty (all zero) fingerprint on failure. | 403 // Returns an empty (all zero) fingerprint on failure. |
| 400 // | 404 // |
| 401 // See SHA-1 caveat on CalculateFingerprint(). | 405 // See SHA-1 caveat on CalculateFingerprint(). |
| 402 static SHA1HashValue CalculateCAFingerprint( | 406 static SHA1HashValue CalculateCAFingerprint( |
| 403 const OSCertHandles& intermediates); | 407 const OSCertHandles& intermediates); |
| 404 | 408 |
| 405 // Calculates the SHA-256 fingerprint of the intermediate CA certificates. | 409 // Calculates the SHA-256 fingerprint of the intermediate CA certificates. |
| 406 // Returns an empty (all zero) fingerprint on failure. | 410 // Returns an empty (all zero) fingerprint on failure. |
| 407 // | 411 // |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 // based on the type of the certificate. | 514 // based on the type of the certificate. |
| 511 std::string default_nickname_; | 515 std::string default_nickname_; |
| 512 #endif | 516 #endif |
| 513 | 517 |
| 514 DISALLOW_COPY_AND_ASSIGN(X509Certificate); | 518 DISALLOW_COPY_AND_ASSIGN(X509Certificate); |
| 515 }; | 519 }; |
| 516 | 520 |
| 517 } // namespace net | 521 } // namespace net |
| 518 | 522 |
| 519 #endif // NET_CERT_X509_CERTIFICATE_H_ | 523 #endif // NET_CERT_X509_CERTIFICATE_H_ |
| OLD | NEW |