| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BASE_X509_CERTIFICATE_H_ | 5 #ifndef NET_BASE_X509_CERTIFICATE_H_ |
| 6 #define NET_BASE_X509_CERTIFICATE_H_ | 6 #define NET_BASE_X509_CERTIFICATE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 | 10 |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 // NOTE: keep this method private, used by IsBlacklisted only. To simplify | 421 // NOTE: keep this method private, used by IsBlacklisted only. To simplify |
| 422 // IsBlacklisted, we strip the leading 0 byte of a serial number, used to | 422 // IsBlacklisted, we strip the leading 0 byte of a serial number, used to |
| 423 // encode a positive DER INTEGER (a signed type) with a most significant bit | 423 // encode a positive DER INTEGER (a signed type) with a most significant bit |
| 424 // of 1. Other code must not use this method for general purpose until this | 424 // of 1. Other code must not use this method for general purpose until this |
| 425 // is fixed. | 425 // is fixed. |
| 426 const std::string& serial_number() const { return serial_number_; } | 426 const std::string& serial_number() const { return serial_number_; } |
| 427 | 427 |
| 428 // IsBlacklisted returns true if this certificate is explicitly blacklisted. | 428 // IsBlacklisted returns true if this certificate is explicitly blacklisted. |
| 429 bool IsBlacklisted() const; | 429 bool IsBlacklisted() const; |
| 430 | 430 |
| 431 // IsPublicKeyBlacklisted returns true iff one of |public_key_hashes| (which |
| 432 // are SHA1 hashes of SubjectPublicKeyInfo structures) is explicitly blocked. |
| 433 static bool IsPublicKeyBlacklisted( |
| 434 const std::vector<SHA1Fingerprint>& public_key_hashes); |
| 435 |
| 431 // IsSHA1HashInSortedArray returns true iff |hash| is in |array|, a sorted | 436 // IsSHA1HashInSortedArray returns true iff |hash| is in |array|, a sorted |
| 432 // array of SHA1 hashes. | 437 // array of SHA1 hashes. |
| 433 static bool IsSHA1HashInSortedArray(const SHA1Fingerprint& hash, | 438 static bool IsSHA1HashInSortedArray(const SHA1Fingerprint& hash, |
| 434 const uint8* array, | 439 const uint8* array, |
| 435 size_t array_byte_len); | 440 size_t array_byte_len); |
| 436 | 441 |
| 437 // Reads a single certificate from |pickle| and returns a platform-specific | 442 // Reads a single certificate from |pickle| and returns a platform-specific |
| 438 // certificate handle. The format of the certificate stored in |pickle| is | 443 // certificate handle. The format of the certificate stored in |pickle| is |
| 439 // not guaranteed to be the same across different underlying cryptographic | 444 // not guaranteed to be the same across different underlying cryptographic |
| 440 // libraries, nor acceptable to CreateFromBytes(). Returns an invalid | 445 // libraries, nor acceptable to CreateFromBytes(). Returns an invalid |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 // (Marked mutable because it's used in a const method.) | 480 // (Marked mutable because it's used in a const method.) |
| 476 mutable base::Lock verification_lock_; | 481 mutable base::Lock verification_lock_; |
| 477 #endif | 482 #endif |
| 478 | 483 |
| 479 DISALLOW_COPY_AND_ASSIGN(X509Certificate); | 484 DISALLOW_COPY_AND_ASSIGN(X509Certificate); |
| 480 }; | 485 }; |
| 481 | 486 |
| 482 } // namespace net | 487 } // namespace net |
| 483 | 488 |
| 484 #endif // NET_BASE_X509_CERTIFICATE_H_ | 489 #endif // NET_BASE_X509_CERTIFICATE_H_ |
| OLD | NEW |