| 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 | |
| 402 // Calculates the SHA-1 fingerprint of the intermediate CA certificates. | 398 // Calculates the SHA-1 fingerprint of the intermediate CA certificates. |
| 403 // Returns an empty (all zero) fingerprint on failure. | 399 // Returns an empty (all zero) fingerprint on failure. |
| 404 // | 400 // |
| 405 // See SHA-1 caveat on CalculateFingerprint(). | 401 // See SHA-1 caveat on CalculateFingerprint(). |
| 406 static SHA1HashValue CalculateCAFingerprint( | 402 static SHA1HashValue CalculateCAFingerprint( |
| 407 const OSCertHandles& intermediates); | 403 const OSCertHandles& intermediates); |
| 408 | 404 |
| 409 // Calculates the SHA-256 fingerprint of the intermediate CA certificates. | 405 // Calculates the SHA-256 fingerprint of the intermediate CA certificates. |
| 410 // Returns an empty (all zero) fingerprint on failure. | 406 // Returns an empty (all zero) fingerprint on failure. |
| 411 // | 407 // |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 // based on the type of the certificate. | 510 // based on the type of the certificate. |
| 515 std::string default_nickname_; | 511 std::string default_nickname_; |
| 516 #endif | 512 #endif |
| 517 | 513 |
| 518 DISALLOW_COPY_AND_ASSIGN(X509Certificate); | 514 DISALLOW_COPY_AND_ASSIGN(X509Certificate); |
| 519 }; | 515 }; |
| 520 | 516 |
| 521 } // namespace net | 517 } // namespace net |
| 522 | 518 |
| 523 #endif // NET_CERT_X509_CERTIFICATE_H_ | 519 #endif // NET_CERT_X509_CERTIFICATE_H_ |
| OLD | NEW |