| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 // The returned pointer must be stored in a scoped_refptr<CryptoModule>. | 125 // The returned pointer must be stored in a scoped_refptr<CryptoModule>. |
| 126 // DEPRECATED: use GetPrivateSlot instead. | 126 // DEPRECATED: use GetPrivateSlot instead. |
| 127 // TODO(mattm): remove usage of this method and remove it. | 127 // TODO(mattm): remove usage of this method and remove it. |
| 128 CryptoModule* GetPrivateModule() const; | 128 CryptoModule* GetPrivateModule() const; |
| 129 | 129 |
| 130 // Get all modules. | 130 // Get all modules. |
| 131 // If |need_rw| is true, only writable modules will be returned. | 131 // If |need_rw| is true, only writable modules will be returned. |
| 132 // TODO(mattm): come up with better alternative to CryptoModuleList. | 132 // TODO(mattm): come up with better alternative to CryptoModuleList. |
| 133 virtual void ListModules(CryptoModuleList* modules, bool need_rw) const; | 133 virtual void ListModules(CryptoModuleList* modules, bool need_rw) const; |
| 134 | 134 |
| 135 // The binary blob |pkcs8_data| is expected to be a DER-encoded ASN.1 PKCS#8 |
| 136 // private key info object. |
| 137 bool ImportPKCS8KeyAndCertificate(const std::string& pkcs8_data, |
| 138 X509Certificate* cert, |
| 139 CryptoModule* module); |
| 140 |
| 135 // Import certificates and private keys from PKCS #12 blob into the module. | 141 // Import certificates and private keys from PKCS #12 blob into the module. |
| 136 // If |is_extractable| is false, mark the private key as being unextractable | 142 // If |is_extractable| is false, mark the private key as being unextractable |
| 137 // from the module. | 143 // from the module. |
| 138 // Returns OK or a network error code such as ERR_PKCS12_IMPORT_BAD_PASSWORD | 144 // Returns OK or a network error code such as ERR_PKCS12_IMPORT_BAD_PASSWORD |
| 139 // or ERR_PKCS12_IMPORT_ERROR. |imported_certs|, if non-NULL, returns a list | 145 // or ERR_PKCS12_IMPORT_ERROR. |imported_certs|, if non-NULL, returns a list |
| 140 // of certs that were imported. | 146 // of certs that were imported. |
| 141 int ImportFromPKCS12(CryptoModule* module, | 147 int ImportFromPKCS12(CryptoModule* module, |
| 142 const std::string& data, | 148 const std::string& data, |
| 143 const base::string16& password, | 149 const base::string16& password, |
| 144 bool is_extractable, | 150 bool is_extractable, |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 scoped_refptr<base::TaskRunner> slow_task_runner_for_test_; | 255 scoped_refptr<base::TaskRunner> slow_task_runner_for_test_; |
| 250 | 256 |
| 251 const scoped_refptr<ObserverListThreadSafe<Observer> > observer_list_; | 257 const scoped_refptr<ObserverListThreadSafe<Observer> > observer_list_; |
| 252 | 258 |
| 253 DISALLOW_COPY_AND_ASSIGN(NSSCertDatabase); | 259 DISALLOW_COPY_AND_ASSIGN(NSSCertDatabase); |
| 254 }; | 260 }; |
| 255 | 261 |
| 256 } // namespace net | 262 } // namespace net |
| 257 | 263 |
| 258 #endif // NET_CERT_NSS_CERT_DATABASE_H_ | 264 #endif // NET_CERT_NSS_CERT_DATABASE_H_ |
| OLD | NEW |