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 NET_CERT_NSS_CERT_DATABASE_H_ | 5 #ifndef NET_CERT_NSS_CERT_DATABASE_H_ |
6 #define NET_CERT_NSS_CERT_DATABASE_H_ | 6 #define NET_CERT_NSS_CERT_DATABASE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
185 int ExportToPKCS12(const CertificateList& certs, | 185 int ExportToPKCS12(const CertificateList& certs, |
186 const base::string16& password, | 186 const base::string16& password, |
187 std::string* output) const; | 187 std::string* output) const; |
188 | 188 |
189 // Uses similar logic to nsNSSCertificateDB::handleCACertDownload to find the | 189 // Uses similar logic to nsNSSCertificateDB::handleCACertDownload to find the |
190 // root. Assumes the list is an ordered hierarchy with the root being either | 190 // root. Assumes the list is an ordered hierarchy with the root being either |
191 // the first or last element. | 191 // the first or last element. |
192 // TODO(mattm): improve this to handle any order. | 192 // TODO(mattm): improve this to handle any order. |
193 X509Certificate* FindRootInList(const CertificateList& certificates) const; | 193 X509Certificate* FindRootInList(const CertificateList& certificates) const; |
194 | 194 |
195 // Import user certificates. | |
mattm
2015/11/06 23:13:00
"Import a user certificate", since it only does on
svaldez
2015/11/10 15:07:50
Done.
| |
196 // Returns OK or a network error code such as ERR_PKCS12_IMPORT_ERROR. | |
197 int ImportUserCert(const std::string& data); | |
198 | |
195 // Import CA certificates. | 199 // Import CA certificates. |
196 // Tries to import all the certificates given. The root will be trusted | 200 // Tries to import all the certificates given. The root will be trusted |
197 // according to |trust_bits|. Any certificates that could not be imported | 201 // according to |trust_bits|. Any certificates that could not be imported |
198 // will be listed in |not_imported|. | 202 // will be listed in |not_imported|. |
199 // Returns false if there is an internal error, otherwise true is returned and | 203 // Returns false if there is an internal error, otherwise true is returned and |
200 // |not_imported| should be checked for any certificates that were not | 204 // |not_imported| should be checked for any certificates that were not |
201 // imported. | 205 // imported. |
202 bool ImportCACerts(const CertificateList& certificates, | 206 bool ImportCACerts(const CertificateList& certificates, |
203 TrustBits trust_bits, | 207 TrustBits trust_bits, |
204 ImportCertFailureList* not_imported); | 208 ImportCertFailureList* not_imported); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
306 const scoped_refptr<base::ObserverListThreadSafe<Observer>> observer_list_; | 310 const scoped_refptr<base::ObserverListThreadSafe<Observer>> observer_list_; |
307 | 311 |
308 base::WeakPtrFactory<NSSCertDatabase> weak_factory_; | 312 base::WeakPtrFactory<NSSCertDatabase> weak_factory_; |
309 | 313 |
310 DISALLOW_COPY_AND_ASSIGN(NSSCertDatabase); | 314 DISALLOW_COPY_AND_ASSIGN(NSSCertDatabase); |
311 }; | 315 }; |
312 | 316 |
313 } // namespace net | 317 } // namespace net |
314 | 318 |
315 #endif // NET_CERT_NSS_CERT_DATABASE_H_ | 319 #endif // NET_CERT_NSS_CERT_DATABASE_H_ |
OLD | NEW |