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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 | 417 |
418 // Performs the platform-dependent part of the Verify() method, verifiying | 418 // Performs the platform-dependent part of the Verify() method, verifiying |
419 // this certificate against the platform's root CA certificates. | 419 // this certificate against the platform's root CA certificates. |
420 // | 420 // |
421 // Parameters and return value are as per Verify(). | 421 // Parameters and return value are as per Verify(). |
422 int VerifyInternal(const std::string& hostname, | 422 int VerifyInternal(const std::string& hostname, |
423 int flags, | 423 int flags, |
424 CRLSet* crl_set, | 424 CRLSet* crl_set, |
425 CertVerifyResult* verify_result) const; | 425 CertVerifyResult* verify_result) const; |
426 | 426 |
427 // The serial number, DER encoded. | 427 // The serial number, DER encoded, possibly including a leading 00 byte. |
428 // NOTE: keep this method private, used by IsBlacklisted only. To simplify | |
429 // IsBlacklisted, we strip the leading 0 byte of a serial number, used to | |
430 // encode a positive DER INTEGER (a signed type) with a most significant bit | |
431 // of 1. Other code must not use this method for general purpose until this | |
432 // is fixed. | |
433 const std::string& serial_number() const { return serial_number_; } | 428 const std::string& serial_number() const { return serial_number_; } |
434 | 429 |
435 // IsBlacklisted returns true if this certificate is explicitly blacklisted. | 430 // IsBlacklisted returns true if this certificate is explicitly blacklisted. |
436 bool IsBlacklisted() const; | 431 bool IsBlacklisted() const; |
437 | 432 |
438 // IsPublicKeyBlacklisted returns true iff one of |public_key_hashes| (which | 433 // IsPublicKeyBlacklisted returns true iff one of |public_key_hashes| (which |
439 // are SHA1 hashes of SubjectPublicKeyInfo structures) is explicitly blocked. | 434 // are SHA1 hashes of SubjectPublicKeyInfo structures) is explicitly blocked. |
440 static bool IsPublicKeyBlacklisted( | 435 static bool IsPublicKeyBlacklisted( |
441 const std::vector<SHA1Fingerprint>& public_key_hashes); | 436 const std::vector<SHA1Fingerprint>& public_key_hashes); |
442 | 437 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 // (Marked mutable because it's used in a const method.) | 482 // (Marked mutable because it's used in a const method.) |
488 mutable base::Lock verification_lock_; | 483 mutable base::Lock verification_lock_; |
489 #endif | 484 #endif |
490 | 485 |
491 DISALLOW_COPY_AND_ASSIGN(X509Certificate); | 486 DISALLOW_COPY_AND_ASSIGN(X509Certificate); |
492 }; | 487 }; |
493 | 488 |
494 } // namespace net | 489 } // namespace net |
495 | 490 |
496 #endif // NET_BASE_X509_CERTIFICATE_H_ | 491 #endif // NET_BASE_X509_CERTIFICATE_H_ |
OLD | NEW |