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_NSS_CERT_DATABASE_H_ | 5 #ifndef NET_CERT_NSS_CERT_DATABASE_H_ |
6 #define NET_CERT_NSS_CERT_DATABASE_H_ | 6 #define NET_CERT_NSS_CERT_DATABASE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 100 |
101 typedef base::Callback<void(bool)> DeleteCertCallback; | 101 typedef base::Callback<void(bool)> DeleteCertCallback; |
102 | 102 |
103 // Creates a NSSCertDatabase that will store public information (such as | 103 // Creates a NSSCertDatabase that will store public information (such as |
104 // certificates and trust records) in |public_slot|, and private information | 104 // certificates and trust records) in |public_slot|, and private information |
105 // (such as keys) in |private_slot|. | 105 // (such as keys) in |private_slot|. |
106 // In general, code should avoid creating an NSSCertDatabase directly, | 106 // In general, code should avoid creating an NSSCertDatabase directly, |
107 // as doing so requires making opinionated decisions about where to store | 107 // as doing so requires making opinionated decisions about where to store |
108 // data, and instead prefer to be passed an existing NSSCertDatabase | 108 // data, and instead prefer to be passed an existing NSSCertDatabase |
109 // instance. | 109 // instance. |
110 // Both slots must not be NULL but can be identical. | 110 // |public_slot| must not be NULL, |private_slot| can be NULL. Both slots can |
| 111 // be identical. |
111 NSSCertDatabase(crypto::ScopedPK11Slot public_slot, | 112 NSSCertDatabase(crypto::ScopedPK11Slot public_slot, |
112 crypto::ScopedPK11Slot private_slot); | 113 crypto::ScopedPK11Slot private_slot); |
113 virtual ~NSSCertDatabase(); | 114 virtual ~NSSCertDatabase(); |
114 | 115 |
115 // Get a list of unique certificates in the certificate database (one | 116 // Get a list of unique certificates in the certificate database (one |
116 // instance of all certificates). | 117 // instance of all certificates). |
117 // DEPRECATED by |ListCerts|. See http://crbug.com/340460. | 118 // DEPRECATED by |ListCerts|. See http://crbug.com/340460. |
118 virtual void ListCertsSync(CertificateList* certs); | 119 virtual void ListCertsSync(CertificateList* certs); |
119 | 120 |
120 // Asynchronously get a list of unique certificates in the certificate | 121 // Asynchronously get a list of unique certificates in the certificate |
(...skipping 16 matching lines...) Expand all Loading... |
137 // this call returns synchronously. Thus, it is possible to call this function | 138 // this call returns synchronously. Thus, it is possible to call this function |
138 // before SetSystemSlot is called and get a NULL result. | 139 // before SetSystemSlot is called and get a NULL result. |
139 // See https://crbug.com/399554 . | 140 // See https://crbug.com/399554 . |
140 virtual crypto::ScopedPK11Slot GetSystemSlot() const; | 141 virtual crypto::ScopedPK11Slot GetSystemSlot() const; |
141 #endif | 142 #endif |
142 | 143 |
143 // Get the default slot for public key data. | 144 // Get the default slot for public key data. |
144 crypto::ScopedPK11Slot GetPublicSlot() const; | 145 crypto::ScopedPK11Slot GetPublicSlot() const; |
145 | 146 |
146 // Get the default slot for private key or mixed private/public key data. | 147 // Get the default slot for private key or mixed private/public key data. |
| 148 // Can return NULL. |
147 crypto::ScopedPK11Slot GetPrivateSlot() const; | 149 crypto::ScopedPK11Slot GetPrivateSlot() const; |
148 | 150 |
149 // Get the default module for public key data. | 151 // Get the default module for public key data. |
150 // The returned pointer must be stored in a scoped_refptr<CryptoModule>. | 152 // The returned pointer must be stored in a scoped_refptr<CryptoModule>. |
151 // DEPRECATED: use GetPublicSlot instead. | 153 // DEPRECATED: use GetPublicSlot instead. |
152 // TODO(mattm): remove usage of this method and remove it. | 154 // TODO(mattm): remove usage of this method and remove it. |
153 CryptoModule* GetPublicModule() const; | 155 CryptoModule* GetPublicModule() const; |
154 | 156 |
155 // Get the default module for private key or mixed private/public key data. | 157 // Get the default module for private key or mixed private/public key data. |
156 // The returned pointer must be stored in a scoped_refptr<CryptoModule>. | 158 // The returned pointer must be stored in a scoped_refptr<CryptoModule>. |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 const scoped_refptr<ObserverListThreadSafe<Observer> > observer_list_; | 303 const scoped_refptr<ObserverListThreadSafe<Observer> > observer_list_; |
302 | 304 |
303 base::WeakPtrFactory<NSSCertDatabase> weak_factory_; | 305 base::WeakPtrFactory<NSSCertDatabase> weak_factory_; |
304 | 306 |
305 DISALLOW_COPY_AND_ASSIGN(NSSCertDatabase); | 307 DISALLOW_COPY_AND_ASSIGN(NSSCertDatabase); |
306 }; | 308 }; |
307 | 309 |
308 } // namespace net | 310 } // namespace net |
309 | 311 |
310 #endif // NET_CERT_NSS_CERT_DATABASE_H_ | 312 #endif // NET_CERT_NSS_CERT_DATABASE_H_ |
OLD | NEW |