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); |