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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // Following this call, the observer CertificatesRefreshed method will be | 47 // Following this call, the observer CertificatesRefreshed method will be |
48 // called so the view can call FilterAndBuildOrgGroupingMap as necessary to | 48 // called so the view can call FilterAndBuildOrgGroupingMap as necessary to |
49 // refresh its tree views. | 49 // refresh its tree views. |
50 void Refresh(); | 50 void Refresh(); |
51 | 51 |
52 // Fill |map| with the certificates matching |filter_type|. | 52 // Fill |map| with the certificates matching |filter_type|. |
53 void FilterAndBuildOrgGroupingMap(net::CertType filter_type, | 53 void FilterAndBuildOrgGroupingMap(net::CertType filter_type, |
54 OrgGroupingMap* map) const; | 54 OrgGroupingMap* map) const; |
55 | 55 |
56 // Get the data to be displayed in |column| for the given |cert|. | 56 // Get the data to be displayed in |column| for the given |cert|. |
57 string16 GetColumnText(const net::X509Certificate& cert, Column column) const; | 57 base::string16 GetColumnText(const net::X509Certificate& cert, Column column)
const; |
58 | 58 |
59 // Import private keys and certificates from PKCS #12 encoded | 59 // Import private keys and certificates from PKCS #12 encoded |
60 // |data|, using the given |password|. If |is_extractable| is false, | 60 // |data|, using the given |password|. If |is_extractable| is false, |
61 // mark the private key as unextractable from the module. | 61 // mark the private key as unextractable from the module. |
62 // Returns a net error code on failure. | 62 // Returns a net error code on failure. |
63 int ImportFromPKCS12(net::CryptoModule* module, const std::string& data, | 63 int ImportFromPKCS12(net::CryptoModule* module, const std::string& data, |
64 const string16& password, bool is_extractable); | 64 const base::string16& password, bool is_extractable); |
65 | 65 |
66 // Import CA certificates. | 66 // Import CA certificates. |
67 // Tries to import all the certificates given. The root will be trusted | 67 // Tries to import all the certificates given. The root will be trusted |
68 // according to |trust_bits|. Any certificates that could not be imported | 68 // according to |trust_bits|. Any certificates that could not be imported |
69 // will be listed in |not_imported|. | 69 // will be listed in |not_imported|. |
70 // |trust_bits| should be a bit field of TRUST* values from NSSCertDatabase. | 70 // |trust_bits| should be a bit field of TRUST* values from NSSCertDatabase. |
71 // Returns false if there is an internal error, otherwise true is returned and | 71 // Returns false if there is an internal error, otherwise true is returned and |
72 // |not_imported| should be checked for any certificates that were not | 72 // |not_imported| should be checked for any certificates that were not |
73 // imported. | 73 // imported. |
74 bool ImportCACerts(const net::CertificateList& certificates, | 74 bool ImportCACerts(const net::CertificateList& certificates, |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 net::NSSCertDatabase* cert_db_; | 112 net::NSSCertDatabase* cert_db_; |
113 net::CertificateList cert_list_; | 113 net::CertificateList cert_list_; |
114 | 114 |
115 // The observer to notify when certificate list is refreshed. | 115 // The observer to notify when certificate list is refreshed. |
116 Observer* observer_; | 116 Observer* observer_; |
117 | 117 |
118 DISALLOW_COPY_AND_ASSIGN(CertificateManagerModel); | 118 DISALLOW_COPY_AND_ASSIGN(CertificateManagerModel); |
119 }; | 119 }; |
120 | 120 |
121 #endif // CHROME_BROWSER_CERTIFICATE_MANAGER_MODEL_H_ | 121 #endif // CHROME_BROWSER_CERTIFICATE_MANAGER_MODEL_H_ |
OLD | NEW |