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_CERT_DATABASE_H_ | 5 #ifndef NET_BASE_CERT_DATABASE_H_ |
6 #define NET_BASE_CERT_DATABASE_H_ | 6 #define NET_BASE_CERT_DATABASE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // Store user (client) certificate. Assumes CheckUserCert has already passed. | 86 // Store user (client) certificate. Assumes CheckUserCert has already passed. |
87 // Returns OK, or ERR_ADD_USER_CERT_FAILED if there was a problem saving to | 87 // Returns OK, or ERR_ADD_USER_CERT_FAILED if there was a problem saving to |
88 // the platform cert database, or possibly other network error codes. | 88 // the platform cert database, or possibly other network error codes. |
89 int AddUserCert(X509Certificate* cert); | 89 int AddUserCert(X509Certificate* cert); |
90 | 90 |
91 #if defined(USE_NSS) || defined(USE_OPENSSL) | 91 #if defined(USE_NSS) || defined(USE_OPENSSL) |
92 // Get a list of unique certificates in the certificate database. (One | 92 // Get a list of unique certificates in the certificate database. (One |
93 // instance of all certificates.) | 93 // instance of all certificates.) |
94 void ListCerts(CertificateList* certs); | 94 void ListCerts(CertificateList* certs); |
95 | 95 |
96 // Get the default module. | 96 // Get the default module for public key data. |
97 // The returned pointer must be stored in a scoped_refptr<CryptoModule>. | 97 // The returned pointer must be stored in a scoped_refptr<CryptoModule>. |
98 CryptoModule* GetDefaultModule() const; | 98 CryptoModule* GetPublicModule() const; |
| 99 |
| 100 // Get the default module for private key or mixed private/public key data. |
| 101 // The returned pointer must be stored in a scoped_refptr<CryptoModule>. |
| 102 CryptoModule* GetPrivateModule() const; |
99 | 103 |
100 // Get all modules. | 104 // Get all modules. |
101 // If |need_rw| is true, only writable modules will be returned. | 105 // If |need_rw| is true, only writable modules will be returned. |
102 void ListModules(CryptoModuleList* modules, bool need_rw) const; | 106 void ListModules(CryptoModuleList* modules, bool need_rw) const; |
103 | 107 |
104 // Import certificates and private keys from PKCS #12 blob into the module. | 108 // Import certificates and private keys from PKCS #12 blob into the module. |
105 // Returns OK or a network error code such as ERR_PKCS12_IMPORT_BAD_PASSWORD | 109 // Returns OK or a network error code such as ERR_PKCS12_IMPORT_BAD_PASSWORD |
106 // or ERR_PKCS12_IMPORT_ERROR. | 110 // or ERR_PKCS12_IMPORT_ERROR. |
107 int ImportFromPKCS12(CryptoModule* module, | 111 int ImportFromPKCS12(CryptoModule* module, |
108 const std::string& data, | 112 const std::string& data, |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 private: | 176 private: |
173 // Broadcasts a notification to all registered observers. | 177 // Broadcasts a notification to all registered observers. |
174 static void NotifyObserversOfUserCertAdded(X509Certificate* cert); | 178 static void NotifyObserversOfUserCertAdded(X509Certificate* cert); |
175 | 179 |
176 DISALLOW_COPY_AND_ASSIGN(CertDatabase); | 180 DISALLOW_COPY_AND_ASSIGN(CertDatabase); |
177 }; | 181 }; |
178 | 182 |
179 } // namespace net | 183 } // namespace net |
180 | 184 |
181 #endif // NET_BASE_CERT_DATABASE_H_ | 185 #endif // NET_BASE_CERT_DATABASE_H_ |
OLD | NEW |