| 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_EV_ROOT_CA_METADATA_H_ | 5 #ifndef NET_CERT_EV_ROOT_CA_METADATA_H_ |
| 6 #define NET_CERT_EV_ROOT_CA_METADATA_H_ | 6 #define NET_CERT_EV_ROOT_CA_METADATA_H_ |
| 7 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #if defined(USE_NSS_CERTS) | 10 #if defined(USE_NSS_CERTS) |
| 11 #include <secoidt.h> | 11 #include <secoidt.h> |
| 12 #endif | 12 #endif |
| 13 | 13 |
| 14 #include <map> | 14 #include <map> |
| 15 #include <set> | 15 #include <set> |
| 16 #include <string> | 16 #include <string> |
| 17 #include <vector> | 17 #include <vector> |
| 18 | 18 |
| 19 #include "base/macros.h" | 19 #include "base/macros.h" |
| 20 #include "net/base/net_export.h" | 20 #include "net/base/net_export.h" |
| 21 #include "net/cert/x509_certificate.h" | 21 #include "net/cert/x509_certificate.h" |
| 22 | 22 |
| 23 namespace base { | 23 namespace base { |
| 24 template <typename T> | 24 template <typename T> |
| 25 struct DefaultLazyInstanceTraits; | 25 struct LazyInstanceTraitsBase; |
| 26 } // namespace base | 26 } // namespace base |
| 27 | 27 |
| 28 namespace net { | 28 namespace net { |
| 29 | 29 |
| 30 namespace der { | 30 namespace der { |
| 31 class Input; | 31 class Input; |
| 32 } // namespace der | 32 } // namespace der |
| 33 | 33 |
| 34 // A singleton. This class stores the meta data of the root CAs that issue | 34 // A singleton. This class stores the meta data of the root CAs that issue |
| 35 // extended-validation (EV) certificates. | 35 // extended-validation (EV) certificates. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 59 // AddEVCA adds an EV CA to the list of known EV CAs with the given policy. | 59 // AddEVCA adds an EV CA to the list of known EV CAs with the given policy. |
| 60 // |policy| is expressed as a string of dotted numbers. It returns true on | 60 // |policy| is expressed as a string of dotted numbers. It returns true on |
| 61 // success. | 61 // success. |
| 62 bool AddEVCA(const SHA1HashValue& fingerprint, const char* policy); | 62 bool AddEVCA(const SHA1HashValue& fingerprint, const char* policy); |
| 63 | 63 |
| 64 // RemoveEVCA removes an EV CA that was previously added by AddEVCA. It | 64 // RemoveEVCA removes an EV CA that was previously added by AddEVCA. It |
| 65 // returns true on success. | 65 // returns true on success. |
| 66 bool RemoveEVCA(const SHA1HashValue& fingerprint); | 66 bool RemoveEVCA(const SHA1HashValue& fingerprint); |
| 67 | 67 |
| 68 private: | 68 private: |
| 69 friend struct base::DefaultLazyInstanceTraits<EVRootCAMetadata>; | 69 friend struct base::LazyInstanceTraitsBase<EVRootCAMetadata>; |
| 70 | 70 |
| 71 EVRootCAMetadata(); | 71 EVRootCAMetadata(); |
| 72 ~EVRootCAMetadata(); | 72 ~EVRootCAMetadata(); |
| 73 | 73 |
| 74 #if defined(USE_NSS_CERTS) | 74 #if defined(USE_NSS_CERTS) |
| 75 typedef std::map<SHA1HashValue, std::vector<PolicyOID>, | 75 typedef std::map<SHA1HashValue, std::vector<PolicyOID>, |
| 76 SHA1HashValueLessThan> PolicyOIDMap; | 76 SHA1HashValueLessThan> PolicyOIDMap; |
| 77 | 77 |
| 78 // RegisterOID registers |policy|, a policy OID in dotted string form, and | 78 // RegisterOID registers |policy|, a policy OID in dotted string form, and |
| 79 // writes the memoized form to |*out|. It returns true on success. | 79 // writes the memoized form to |*out|. It returns true on success. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 95 PolicyOIDMap ev_policy_; | 95 PolicyOIDMap ev_policy_; |
| 96 std::set<std::string> policy_oids_; | 96 std::set<std::string> policy_oids_; |
| 97 #endif | 97 #endif |
| 98 | 98 |
| 99 DISALLOW_COPY_AND_ASSIGN(EVRootCAMetadata); | 99 DISALLOW_COPY_AND_ASSIGN(EVRootCAMetadata); |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 } // namespace net | 102 } // namespace net |
| 103 | 103 |
| 104 #endif // NET_CERT_EV_ROOT_CA_METADATA_H_ | 104 #endif // NET_CERT_EV_ROOT_CA_METADATA_H_ |
| OLD | NEW |