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

Unified Diff: chromeos/network/onc/onc_certificate_importer_impl.h

Issue 148183013: Use per-user nssdb in onc certificate importer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix browser_tests compile Created 6 years, 10 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
Index: chromeos/network/onc/onc_certificate_importer_impl.h
diff --git a/chromeos/network/onc/onc_certificate_importer_impl.h b/chromeos/network/onc/onc_certificate_importer_impl.h
index 82db305fb7f0213458847744edc7837eff2051d7..36bc413ae910ad4a5f8c30251c9393697211dea7 100644
--- a/chromeos/network/onc/onc_certificate_importer_impl.h
+++ b/chromeos/network/onc/onc_certificate_importer_impl.h
@@ -22,6 +22,7 @@ class ListValue;
}
namespace net {
+class NSSCertDatabase;
class X509Certificate;
typedef std::vector<scoped_refptr<X509Certificate> > CertificateList;
}
@@ -40,7 +41,7 @@ class CHROMEOS_EXPORT CertificateImporterImpl : public CertificateImporter {
typedef std::map<std::string, scoped_refptr<net::X509Certificate> >
CertsByGUID;
- CertificateImporterImpl();
+ explicit CertificateImporterImpl(net::NSSCertDatabase* target_nssdb_);
// CertificateImporter overrides
virtual bool ImportCertificates(
@@ -57,15 +58,17 @@ class CHROMEOS_EXPORT CertificateImporterImpl : public CertificateImporter {
net::CertificateList* onc_trusted_certificates,
CertsByGUID* imported_server_and_ca_certs);
+ private:
// Lists the certificates that have the string |label| as their certificate
// nickname (exact match).
static void ListCertsWithNickname(const std::string& label,
- net::CertificateList* result);
+ net::CertificateList* result,
+ net::NSSCertDatabase* target_nssdb);
- private:
// Deletes any certificate that has the string |label| as its nickname (exact
// match).
- static bool DeleteCertAndKeyByNickname(const std::string& label);
+ static bool DeleteCertAndKeyByNickname(const std::string& label,
+ net::NSSCertDatabase* target_nssdb);
// Parses and stores/removes |certificate| in/from the certificate
// store. Returns true if the operation succeeded.
@@ -90,6 +93,9 @@ class CHROMEOS_EXPORT CertificateImporterImpl : public CertificateImporter {
bool ParseClientCertificate(const std::string& guid,
const base::DictionaryValue& certificate);
+ // The certificate database to which certificates are imported.
+ net::NSSCertDatabase* target_nssdb_;
+
DISALLOW_COPY_AND_ASSIGN(CertificateImporterImpl);
};

Powered by Google App Engine
This is Rietveld 408576698