}
namespace net {
+class NSSCertDatabase;
class X509Certificate;
typedef std::vector<scoped_refptr<X509Certificate> > CertificateList;
}
typedef std::map<std::string, scoped_refptr<net::X509Certificate> >
CertsByGUID;
- CertificateImporterImpl();
+ explicit CertificateImporterImpl(net::NSSCertDatabase* target_nssdb_);
// CertificateImporter overrides
virtual bool ImportCertificates(
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.
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);
};