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

Unified Diff: net/cert/nss_cert_database.h

Issue 18121007: *WIP* Store NSS slots per profile. Move keygen to chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: certdb: handle GetCertTrust and IsUntrusted, failed attempt to handle SetCertTrust Created 7 years, 1 month 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/cert/cert_database_nss.cc ('k') | net/cert/nss_cert_database.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/nss_cert_database.h
diff --git a/net/cert/nss_cert_database.h b/net/cert/nss_cert_database.h
index 9db1b75d973dcd84adb9390126f88b21518d1434..6679d01a98d76dc1ee99b2fcb02ab19494b78672 100644
--- a/net/cert/nss_cert_database.h
+++ b/net/cert/nss_cert_database.h
@@ -11,6 +11,7 @@
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/strings/string16.h"
+#include "crypto/scoped_nss_types.h"
#include "net/base/net_export.h"
#include "net/cert/cert_type.h"
#include "net/cert/x509_certificate.h"
@@ -92,19 +93,27 @@ class NET_EXPORT NSSCertDatabase {
// Get a list of unique certificates in the certificate database (one
// instance of all certificates).
- void ListCerts(CertificateList* certs);
+ virtual void ListCerts(CertificateList* certs);
+
+ // Get the default slot for public key data.
+ virtual crypto::ScopedPK11Slot GetPublicSlot() const;
+
+ // Get the default slot for private key or mixed private/public key data.
+ virtual crypto::ScopedPK11Slot GetPrivateSlot() const;
// Get the default module for public key data.
// The returned pointer must be stored in a scoped_refptr<CryptoModule>.
+ // DEPRECATED: use GetPublicSlot instead.
CryptoModule* GetPublicModule() const;
// Get the default module for private key or mixed private/public key data.
// The returned pointer must be stored in a scoped_refptr<CryptoModule>.
+ // DEPRECATED: use GetPrivateSlot instead.
CryptoModule* GetPrivateModule() const;
// Get all modules.
// If |need_rw| is true, only writable modules will be returned.
- void ListModules(CryptoModuleList* modules, bool need_rw) const;
+ virtual void ListModules(CryptoModuleList* modules, bool need_rw) const;
// Import certificates and private keys from PKCS #12 blob into the module.
// If |is_extractable| is false, mark the private key as being unextractable
@@ -157,18 +166,19 @@ class NET_EXPORT NSSCertDatabase {
ImportCertFailureList* not_imported);
// Get trust bits for certificate.
- TrustBits GetCertTrust(const X509Certificate* cert, CertType type) const;
+ virtual TrustBits GetCertTrust(const X509Certificate* cert,
+ CertType type) const;
// IsUntrusted returns true if |cert| is specifically untrusted. These
// certificates are stored in the database for the specific purpose of
// rejecting them.
- bool IsUntrusted(const X509Certificate* cert) const;
+ virtual bool IsUntrusted(const X509Certificate* cert) const;
// Set trust values for certificate.
// Returns true on success or false on failure.
- bool SetCertTrust(const X509Certificate* cert,
- CertType type,
- TrustBits trust_bits);
+ virtual bool SetCertTrust(const X509Certificate* cert,
+ CertType type,
+ TrustBits trust_bits);
// Delete certificate and associated private key (if one exists).
// |cert| is still valid when this function returns. Returns true on
@@ -187,12 +197,13 @@ class NET_EXPORT NSSCertDatabase {
// on the same thread on which AddObserver() was called.
void RemoveObserver(Observer* observer);
+ protected:
+ NSSCertDatabase();
+ virtual ~NSSCertDatabase();
+
private:
friend struct DefaultSingletonTraits<NSSCertDatabase>;
- NSSCertDatabase();
- ~NSSCertDatabase();
-
// Broadcasts notifications to all registered observers.
void NotifyObserversOfCertAdded(const X509Certificate* cert);
void NotifyObserversOfCertRemoved(const X509Certificate* cert);
« no previous file with comments | « net/cert/cert_database_nss.cc ('k') | net/cert/nss_cert_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698