| 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_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 | 7 |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 kPublicKeyTypeDH, | 81 kPublicKeyTypeDH, |
| 82 kPublicKeyTypeECDH | 82 kPublicKeyTypeECDH |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 // Predicate functor used in maps when X509Certificate is used as the key. | 85 // Predicate functor used in maps when X509Certificate is used as the key. |
| 86 class NET_EXPORT LessThan { | 86 class NET_EXPORT LessThan { |
| 87 public: | 87 public: |
| 88 bool operator() (X509Certificate* lhs, X509Certificate* rhs) const; | 88 bool operator() (X509Certificate* lhs, X509Certificate* rhs) const; |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 enum VerifyFlags { | |
| 92 // If set, enables online revocation checking via CRLs and OCSP for the | |
| 93 // certificate chain. | |
| 94 VERIFY_REV_CHECKING_ENABLED = 1 << 0, | |
| 95 | |
| 96 // If set, and the certificate being verified may be an EV certificate, | |
| 97 // attempt to verify the certificate according to the EV processing | |
| 98 // guidelines. In order to successfully verify a certificate as EV, | |
| 99 // either an online or offline revocation check must be successfully | |
| 100 // completed. To ensure it's possible to complete a revocation check, | |
| 101 // callers should also specify either VERIFY_REV_CHECKING_ENABLED or | |
| 102 // VERIFY_REV_CHECKING_ENABLED_EV_ONLY (to enable online checks), and | |
| 103 // VERIFY_CERT_IO_ENABLED (to enable network fetches for online checks). | |
| 104 VERIFY_EV_CERT = 1 << 1, | |
| 105 | |
| 106 // If set, permits NSS to use the network when verifying certificates, | |
| 107 // such as to fetch missing intermediates or to check OCSP or CRLs. | |
| 108 // TODO(rsleevi): http://crbug.com/143300 - Define this flag for all | |
| 109 // verification engines with well-defined semantics, rather than being | |
| 110 // NSS only. | |
| 111 VERIFY_CERT_IO_ENABLED = 1 << 2, | |
| 112 | |
| 113 // If set, enables online revocation checking via CRLs or OCSP, but only | |
| 114 // for certificates which may be EV, and only when VERIFY_EV_CERT is also | |
| 115 // set. | |
| 116 VERIFY_REV_CHECKING_ENABLED_EV_ONLY = 1 << 3, | |
| 117 }; | |
| 118 | |
| 119 enum Format { | 91 enum Format { |
| 120 // The data contains a single DER-encoded certificate, or a PEM-encoded | 92 // The data contains a single DER-encoded certificate, or a PEM-encoded |
| 121 // DER certificate with the PEM encoding block name of "CERTIFICATE". | 93 // DER certificate with the PEM encoding block name of "CERTIFICATE". |
| 122 // Any subsequent blocks will be ignored. | 94 // Any subsequent blocks will be ignored. |
| 123 FORMAT_SINGLE_CERTIFICATE = 1 << 0, | 95 FORMAT_SINGLE_CERTIFICATE = 1 << 0, |
| 124 | 96 |
| 125 // The data contains a sequence of one or more PEM-encoded, DER | 97 // The data contains a sequence of one or more PEM-encoded, DER |
| 126 // certificates, with the PEM encoding block name of "CERTIFICATE". | 98 // certificates, with the PEM encoding block name of "CERTIFICATE". |
| 127 // All PEM blocks will be parsed, until the first error is encountered. | 99 // All PEM blocks will be parsed, until the first error is encountered. |
| 128 FORMAT_PEM_CERT_SEQUENCE = 1 << 1, | 100 FORMAT_PEM_CERT_SEQUENCE = 1 << 1, |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 // based on the type of the certificate. | 511 // based on the type of the certificate. |
| 540 std::string default_nickname_; | 512 std::string default_nickname_; |
| 541 #endif | 513 #endif |
| 542 | 514 |
| 543 DISALLOW_COPY_AND_ASSIGN(X509Certificate); | 515 DISALLOW_COPY_AND_ASSIGN(X509Certificate); |
| 544 }; | 516 }; |
| 545 | 517 |
| 546 } // namespace net | 518 } // namespace net |
| 547 | 519 |
| 548 #endif // NET_BASE_X509_CERTIFICATE_H_ | 520 #endif // NET_BASE_X509_CERTIFICATE_H_ |
| OLD | NEW |