| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 // Check whether this is a valid user cert that we have the private key for. | 61 // Check whether this is a valid user cert that we have the private key for. |
| 62 // Returns OK or a network error code such as ERR_CERT_CONTAINS_ERRORS. | 62 // Returns OK or a network error code such as ERR_CERT_CONTAINS_ERRORS. |
| 63 int CheckUserCert(X509Certificate* cert); | 63 int CheckUserCert(X509Certificate* cert); |
| 64 | 64 |
| 65 // Store user (client) certificate. Assumes CheckUserCert has already passed. | 65 // Store user (client) certificate. Assumes CheckUserCert has already passed. |
| 66 // Returns OK, or ERR_ADD_USER_CERT_FAILED if there was a problem saving to | 66 // Returns OK, or ERR_ADD_USER_CERT_FAILED if there was a problem saving to |
| 67 // the platform cert database, or possibly other network error codes. | 67 // the platform cert database, or possibly other network error codes. |
| 68 int AddUserCert(X509Certificate* cert); | 68 int AddUserCert(X509Certificate* cert); |
| 69 | 69 |
| 70 #if defined(USE_NSS) | 70 #if defined(USE_NSS) || defined(USE_OPENSSL) |
| 71 // Get a list of unique certificates in the certificate database. (One | 71 // Get a list of unique certificates in the certificate database. (One |
| 72 // instance of all certificates.) | 72 // instance of all certificates.) |
| 73 void ListCerts(CertificateList* certs); | 73 void ListCerts(CertificateList* certs); |
| 74 | 74 |
| 75 // Import certificates and private keys from PKCS #12 blob. | 75 // Import certificates and private keys from PKCS #12 blob. |
| 76 // Returns OK or a network error code such as ERR_PKCS12_IMPORT_BAD_PASSWORD | 76 // Returns OK or a network error code such as ERR_PKCS12_IMPORT_BAD_PASSWORD |
| 77 // or ERR_PKCS12_IMPORT_ERROR. | 77 // or ERR_PKCS12_IMPORT_ERROR. |
| 78 int ImportFromPKCS12(const std::string& data, const string16& password); | 78 int ImportFromPKCS12(const std::string& data, const string16& password); |
| 79 | 79 |
| 80 // Export the given certificates and private keys into a PKCS #12 blob, | 80 // Export the given certificates and private keys into a PKCS #12 blob, |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 bool DeleteCertAndKey(const X509Certificate* cert); | 126 bool DeleteCertAndKey(const X509Certificate* cert); |
| 127 #endif | 127 #endif |
| 128 | 128 |
| 129 private: | 129 private: |
| 130 DISALLOW_COPY_AND_ASSIGN(CertDatabase); | 130 DISALLOW_COPY_AND_ASSIGN(CertDatabase); |
| 131 }; | 131 }; |
| 132 | 132 |
| 133 } // namespace net | 133 } // namespace net |
| 134 | 134 |
| 135 #endif // NET_BASE_CERT_DATABASE_H_ | 135 #endif // NET_BASE_CERT_DATABASE_H_ |
| OLD | NEW |