summaryrefslogtreecommitdiffstats
path: root/chrome/browser/certificate_manager_model.h
diff options
context:
space:
mode:
authormattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-12 22:52:52 +0000
committermattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-12 22:52:52 +0000
commit2feacc349a55719e56d1713e5e466b035199f901 (patch)
treeaac2b81bfa096eeac62671665f7aed6925671226 /chrome/browser/certificate_manager_model.h
parent3e2ad0b931c70b2d17da437fdbf988742de9b5cb (diff)
downloadchromium_src-2feacc349a55719e56d1713e5e466b035199f901.zip
chromium_src-2feacc349a55719e56d1713e5e466b035199f901.tar.gz
chromium_src-2feacc349a55719e56d1713e5e466b035199f901.tar.bz2
DOMUI cert manager: Add CA cert import.
Minor cleanup of CertificateManagerModel by removing some wrappers of CertDatabase readonly functions. BUG=19991 TEST=manual Review URL: http://codereview.chromium.org/3516023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62348 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/certificate_manager_model.h')
-rw-r--r--chrome/browser/certificate_manager_model.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/chrome/browser/certificate_manager_model.h b/chrome/browser/certificate_manager_model.h
index e43af4c..12c16bb 100644
--- a/chrome/browser/certificate_manager_model.h
+++ b/chrome/browser/certificate_manager_model.h
@@ -41,6 +41,9 @@ class CertificateManagerModel {
explicit CertificateManagerModel(Observer* observer);
~CertificateManagerModel();
+ // Accessor for read-only access to the underlying CertDatabase.
+ const net::CertDatabase& cert_db() const { return cert_db_; }
+
// Refresh the list of certs. Following this call, the observer
// CertificatesRefreshed method will be called so the view can call
// FilterAndBuildOrgGroupingMap as necessary to refresh its tree views.
@@ -57,17 +60,18 @@ class CertificateManagerModel {
// |password|. Returns a net error code on failure.
int ImportFromPKCS12(const std::string& data, const string16& password);
- // Export certificates as PKCS #12 encoded |output|, using the given
- // |password|. Returns number of certs exported.
- int ExportToPKCS12(const net::CertificateList& certs,
- const string16& password,
- std::string* output) const;
-
- // Get trust bits for certificate.
- // Return value will be a bit field of TRUST_* values from CertDatabase, or
+ // Import CA certificates.
+ // Tries to import all the certificates given. The root will be trusted
+ // according to |trust_bits|. Any certificates that could not be imported
+ // will be listed in |not_imported|.
+ // |trust_bits| should be a bit field of TRUST_* values from CertDatabase, or
// UNTRUSTED.
- unsigned int GetCertTrust(const net::X509Certificate* cert,
- net::CertType type) const;
+ // Returns false if there is an internal error, otherwise true is returned and
+ // |not_imported| should be checked for any certificates that were not
+ // imported.
+ bool ImportCACerts(const net::CertificateList& certificates,
+ unsigned int trust_bits,
+ net::CertDatabase::ImportCertFailureList* not_imported);
// Set trust values for certificate.
// |trust_bits| should be a bit field of TRUST_* values from CertDatabase, or