Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(428)

Unified Diff: net/base/cert_database_nss.cc

Issue 3192021: Add ListCerts method to CertDatabase. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: comment fixes Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/cert_database.h ('k') | net/base/cert_database_nss_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/cert_database_nss.cc
diff --git a/net/base/cert_database_nss.cc b/net/base/cert_database_nss.cc
index b8be38c8aa09f1d9116ce3d4508f33bfd34ac53c..5ce1389948c98609c991ca0228bf4c3d0a7b7cb3 100644
--- a/net/base/cert_database_nss.cc
+++ b/net/base/cert_database_nss.cc
@@ -89,6 +89,22 @@ int CertDatabase::AddUserCert(X509Certificate* cert_obj) {
return OK;
}
+void CertDatabase::ListCerts(CertificateList* certs) {
+ certs->clear();
+
+ CERTCertList* cert_list = PK11_ListCerts(PK11CertListUnique, NULL);
+ CERTCertListNode* node;
+ for (node = CERT_LIST_HEAD(cert_list);
+ !CERT_LIST_END(node, cert_list);
+ node = CERT_LIST_NEXT(node)) {
+ certs->push_back(X509Certificate::CreateFromHandle(
+ node->cert,
+ X509Certificate::SOURCE_LONE_CERT_IMPORT,
+ X509Certificate::OSCertHandles()));
+ }
+ CERT_DestroyCertList(cert_list);
+}
+
int CertDatabase::ImportFromPKCS12(
const std::string& data, const string16& password) {
return psm::nsPKCS12Blob_Import(data.data(), data.size(), password);
« no previous file with comments | « net/base/cert_database.h ('k') | net/base/cert_database_nss_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698