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 CHROME_BROWSER_CERTIFICATE_MANAGER_MODEL_H_ | 5 #ifndef CHROME_BROWSER_CERTIFICATE_MANAGER_MODEL_H_ |
6 #define CHROME_BROWSER_CERTIFICATE_MANAGER_MODEL_H_ | 6 #define CHROME_BROWSER_CERTIFICATE_MANAGER_MODEL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 // Get the data to be displayed in |column| for the given |cert|. | 75 // Get the data to be displayed in |column| for the given |cert|. |
76 base::string16 GetColumnText(const net::X509Certificate& cert, Column column)
const; | 76 base::string16 GetColumnText(const net::X509Certificate& cert, Column column)
const; |
77 | 77 |
78 // Import private keys and certificates from PKCS #12 encoded | 78 // Import private keys and certificates from PKCS #12 encoded |
79 // |data|, using the given |password|. If |is_extractable| is false, | 79 // |data|, using the given |password|. If |is_extractable| is false, |
80 // mark the private key as unextractable from the module. | 80 // mark the private key as unextractable from the module. |
81 // Returns a net error code on failure. | 81 // Returns a net error code on failure. |
82 int ImportFromPKCS12(net::CryptoModule* module, const std::string& data, | 82 int ImportFromPKCS12(net::CryptoModule* module, const std::string& data, |
83 const base::string16& password, bool is_extractable); | 83 const base::string16& password, bool is_extractable); |
84 | 84 |
| 85 // Import user certificate from DER encoded |data|. |
| 86 // Returns a net error code on failure. |
| 87 int ImportUserCert(const std::string& data); |
| 88 |
85 // Import CA certificates. | 89 // Import CA certificates. |
86 // Tries to import all the certificates given. The root will be trusted | 90 // Tries to import all the certificates given. The root will be trusted |
87 // according to |trust_bits|. Any certificates that could not be imported | 91 // according to |trust_bits|. Any certificates that could not be imported |
88 // will be listed in |not_imported|. | 92 // will be listed in |not_imported|. |
89 // |trust_bits| should be a bit field of TRUST* values from NSSCertDatabase. | 93 // |trust_bits| should be a bit field of TRUST* values from NSSCertDatabase. |
90 // Returns false if there is an internal error, otherwise true is returned and | 94 // Returns false if there is an internal error, otherwise true is returned and |
91 // |not_imported| should be checked for any certificates that were not | 95 // |not_imported| should be checked for any certificates that were not |
92 // imported. | 96 // imported. |
93 bool ImportCACerts(const net::CertificateList& certificates, | 97 bool ImportCACerts(const net::CertificateList& certificates, |
94 net::NSSCertDatabase::TrustBits trust_bits, | 98 net::NSSCertDatabase::TrustBits trust_bits, |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 bool is_user_db_available_; | 160 bool is_user_db_available_; |
157 bool is_tpm_available_; | 161 bool is_tpm_available_; |
158 | 162 |
159 // The observer to notify when certificate list is refreshed. | 163 // The observer to notify when certificate list is refreshed. |
160 Observer* observer_; | 164 Observer* observer_; |
161 | 165 |
162 DISALLOW_COPY_AND_ASSIGN(CertificateManagerModel); | 166 DISALLOW_COPY_AND_ASSIGN(CertificateManagerModel); |
163 }; | 167 }; |
164 | 168 |
165 #endif // CHROME_BROWSER_CERTIFICATE_MANAGER_MODEL_H_ | 169 #endif // CHROME_BROWSER_CERTIFICATE_MANAGER_MODEL_H_ |
OLD | NEW |