OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 // Check whether this is a valid user cert that we have the private key for. | 62 // Check whether this is a valid user cert that we have the private key for. |
63 // Returns OK or a network error code such as ERR_CERT_CONTAINS_ERRORS. | 63 // Returns OK or a network error code such as ERR_CERT_CONTAINS_ERRORS. |
64 int CheckUserCert(X509Certificate* cert); | 64 int CheckUserCert(X509Certificate* cert); |
65 | 65 |
66 // Store user (client) certificate. Assumes CheckUserCert has already passed. | 66 // Store user (client) certificate. Assumes CheckUserCert has already passed. |
67 // Returns OK, or ERR_ADD_USER_CERT_FAILED if there was a problem saving to | 67 // Returns OK, or ERR_ADD_USER_CERT_FAILED if there was a problem saving to |
68 // the platform cert database, or possibly other network error codes. | 68 // the platform cert database, or possibly other network error codes. |
69 int AddUserCert(X509Certificate* cert); | 69 int AddUserCert(X509Certificate* cert); |
70 | 70 |
71 #if defined(USE_NSS) | 71 #if defined(USE_NSS) |
| 72 // Get a list of unique certificates in the certificate database. (One |
| 73 // instance of all certificates.) |
| 74 void ListCerts(CertificateList* certs); |
| 75 |
72 // Import certificates and private keys from PKCS #12 blob. | 76 // Import certificates and private keys from PKCS #12 blob. |
73 // Returns OK or a network error code such as ERR_PKCS12_IMPORT_BAD_PASSWORD | 77 // Returns OK or a network error code such as ERR_PKCS12_IMPORT_BAD_PASSWORD |
74 // or ERR_PKCS12_IMPORT_ERROR. | 78 // or ERR_PKCS12_IMPORT_ERROR. |
75 int ImportFromPKCS12(const std::string& data, const string16& password); | 79 int ImportFromPKCS12(const std::string& data, const string16& password); |
76 | 80 |
77 // Export the given certificates and private keys into a PKCS #12 blob, | 81 // Export the given certificates and private keys into a PKCS #12 blob, |
78 // storing into |output|. | 82 // storing into |output|. |
79 // Returns the number of certificates successfully exported. | 83 // Returns the number of certificates successfully exported. |
80 int ExportToPKCS12(const CertificateList& certs, const string16& password, | 84 int ExportToPKCS12(const CertificateList& certs, const string16& password, |
81 std::string* output); | 85 std::string* output); |
(...skipping 26 matching lines...) Expand all Loading... |
108 bool DeleteCertAndKey(const X509Certificate* cert); | 112 bool DeleteCertAndKey(const X509Certificate* cert); |
109 #endif | 113 #endif |
110 | 114 |
111 private: | 115 private: |
112 DISALLOW_COPY_AND_ASSIGN(CertDatabase); | 116 DISALLOW_COPY_AND_ASSIGN(CertDatabase); |
113 }; | 117 }; |
114 | 118 |
115 } // namespace net | 119 } // namespace net |
116 | 120 |
117 #endif // NET_BASE_CERT_DATABASE_H_ | 121 #endif // NET_BASE_CERT_DATABASE_H_ |
OLD | NEW |