2012-05-31 09:33:35 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2006-08-12 06:39:47 +00:00
|
|
|
|
2015-12-04 18:36:51 +00:00
|
|
|
#ifndef nsKeyModule_h
|
|
|
|
#define nsKeyModule_h
|
2006-08-12 06:39:47 +00:00
|
|
|
|
2015-12-04 18:36:51 +00:00
|
|
|
#include "ScopedNSSTypes.h"
|
2006-08-12 06:39:47 +00:00
|
|
|
#include "nsIKeyModule.h"
|
2015-12-04 00:22:34 +00:00
|
|
|
#include "nsNSSShutDown.h"
|
2006-08-12 06:39:47 +00:00
|
|
|
#include "pk11pub.h"
|
|
|
|
|
|
|
|
#define NS_KEYMODULEOBJECT_CID \
|
2015-12-04 18:36:51 +00:00
|
|
|
{ 0x9d383ddd, 0x6856, 0x4187, {0x84, 0x85, 0xf3, 0x61, 0x95, 0xb2, 0x9a, 0x0e} }
|
2006-08-12 06:39:47 +00:00
|
|
|
#define NS_KEYMODULEOBJECT_CONTRACTID "@mozilla.org/security/keyobject;1"
|
|
|
|
|
|
|
|
#define NS_KEYMODULEOBJECTFACTORY_CID \
|
2015-12-04 18:36:51 +00:00
|
|
|
{ 0x2a35dd47, 0xb026, 0x4e8d, {0xb6, 0xb7, 0x57, 0x40, 0xf6, 0x1a, 0xb9, 0x02} }
|
2006-08-12 06:39:47 +00:00
|
|
|
#define NS_KEYMODULEOBJECTFACTORY_CONTRACTID \
|
|
|
|
"@mozilla.org/security/keyobjectfactory;1"
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
class nsKeyObject final : public nsIKeyObject
|
2015-12-04 00:22:34 +00:00
|
|
|
, public nsNSSShutDownObject
|
2006-08-12 06:39:47 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsKeyObject();
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIKEYOBJECT
|
|
|
|
|
|
|
|
private:
|
|
|
|
~nsKeyObject();
|
2015-12-04 18:36:51 +00:00
|
|
|
|
2006-08-12 06:39:47 +00:00
|
|
|
// Disallow copy constructor
|
|
|
|
nsKeyObject(nsKeyObject&);
|
|
|
|
|
2015-12-04 18:36:51 +00:00
|
|
|
ScopedPK11SymKey mSymKey;
|
2015-12-04 00:22:34 +00:00
|
|
|
|
|
|
|
virtual void virtualDestroyNSSReference() override;
|
|
|
|
void destructorSafeDestroyNSSReference();
|
2006-08-12 06:39:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
class nsKeyObjectFactory final : public nsIKeyObjectFactory
|
2015-12-04 00:22:34 +00:00
|
|
|
, public nsNSSShutDownObject
|
2006-08-12 06:39:47 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsKeyObjectFactory();
|
|
|
|
|
2013-07-19 02:24:14 +00:00
|
|
|
NS_DECL_THREADSAFE_ISUPPORTS
|
2006-08-12 06:39:47 +00:00
|
|
|
NS_DECL_NSIKEYOBJECTFACTORY
|
|
|
|
|
|
|
|
private:
|
2007-04-23 14:21:53 +00:00
|
|
|
~nsKeyObjectFactory() {}
|
2006-08-12 06:39:47 +00:00
|
|
|
|
|
|
|
// Disallow copy constructor
|
|
|
|
nsKeyObjectFactory(nsKeyObjectFactory&);
|
2015-12-04 00:22:34 +00:00
|
|
|
|
|
|
|
// No NSS resources to release.
|
|
|
|
virtual void virtualDestroyNSSReference() override {}
|
2006-08-12 06:39:47 +00:00
|
|
|
};
|
|
|
|
|
2015-12-04 18:36:51 +00:00
|
|
|
#endif // nsKeyModule_h
|