2001-02-07 02:01:33 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
2012-05-31 13:33:35 +04: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/. */
|
2001-02-07 02:01:33 +03:00
|
|
|
|
2016-03-30 04:14:28 +03:00
|
|
|
#ifndef nsPK11TokenDB_h
|
|
|
|
#define nsPK11TokenDB_h
|
2001-02-07 02:01:33 +03:00
|
|
|
|
2001-05-16 00:40:28 +04:00
|
|
|
#include "nsCOMPtr.h"
|
2002-09-17 22:51:22 +04:00
|
|
|
#include "nsIPK11Token.h"
|
2016-03-30 04:14:28 +03:00
|
|
|
#include "nsIPK11TokenDB.h"
|
|
|
|
#include "nsISupports.h"
|
2001-05-16 00:40:28 +04:00
|
|
|
#include "nsNSSHelper.h"
|
2003-01-18 17:03:00 +03:00
|
|
|
#include "nsNSSShutDown.h"
|
2016-03-30 04:14:28 +03:00
|
|
|
#include "nsString.h"
|
|
|
|
#include "pk11func.h"
|
|
|
|
#include "ScopedNSSTypes.h"
|
2001-05-16 00:40:28 +04:00
|
|
|
|
2003-01-18 17:03:00 +03:00
|
|
|
class nsPK11Token : public nsIPK11Token,
|
|
|
|
public nsNSSShutDownObject
|
2001-05-16 00:40:28 +04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIPK11TOKEN
|
|
|
|
|
2014-09-01 03:26:27 +04:00
|
|
|
explicit nsPK11Token(PK11SlotInfo *slot);
|
2001-05-16 00:40:28 +04:00
|
|
|
|
2014-06-24 02:40:03 +04:00
|
|
|
protected:
|
|
|
|
virtual ~nsPK11Token();
|
|
|
|
|
2001-05-16 00:40:28 +04:00
|
|
|
private:
|
|
|
|
friend class nsPK11TokenDB;
|
2016-03-30 04:14:29 +03:00
|
|
|
nsresult refreshTokenInfo(const nsNSSShutDownPreventionLock& proofOfLock);
|
2001-05-16 00:40:28 +04:00
|
|
|
|
2016-09-30 19:46:13 +03:00
|
|
|
nsCString mTokenName;
|
|
|
|
nsCString mTokenLabel;
|
|
|
|
nsCString mTokenManufacturerID;
|
|
|
|
nsCString mTokenHWVersion;
|
|
|
|
nsCString mTokenFWVersion;
|
|
|
|
nsCString mTokenSerialNum;
|
2016-03-30 04:14:28 +03:00
|
|
|
mozilla::UniquePK11SlotInfo mSlot;
|
2005-06-02 05:17:35 +04:00
|
|
|
int mSeries;
|
2001-05-16 00:40:28 +04:00
|
|
|
nsCOMPtr<nsIInterfaceRequestor> mUIContext;
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void virtualDestroyNSSReference() override;
|
2003-01-18 17:03:00 +03:00
|
|
|
void destructorSafeDestroyNSSReference();
|
2016-09-30 19:46:13 +03:00
|
|
|
nsresult GetAttributeHelper(const nsACString& attribute,
|
|
|
|
/*out*/ nsACString& xpcomOutParam);
|
2001-05-16 00:40:28 +04:00
|
|
|
};
|
2001-02-07 02:01:33 +03:00
|
|
|
|
|
|
|
class nsPK11TokenDB : public nsIPK11TokenDB
|
2016-03-30 04:14:28 +03:00
|
|
|
, public nsNSSShutDownObject
|
2001-02-07 02:01:33 +03:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIPK11TOKENDB
|
|
|
|
|
|
|
|
nsPK11TokenDB();
|
2014-06-24 02:40:03 +04:00
|
|
|
|
|
|
|
protected:
|
2001-02-07 02:01:33 +03:00
|
|
|
virtual ~nsPK11TokenDB();
|
2016-03-30 04:14:28 +03:00
|
|
|
|
|
|
|
// Nothing to release.
|
|
|
|
virtual void virtualDestroyNSSReference() override {}
|
2001-02-07 02:01:33 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#define NS_PK11TOKENDB_CID \
|
|
|
|
{ 0xb084a2ce, 0x1dd1, 0x11b2, \
|
|
|
|
{ 0xbf, 0x10, 0x83, 0x24, 0xf8, 0xe0, 0x65, 0xcc }}
|
|
|
|
|
2016-03-30 04:14:28 +03:00
|
|
|
#endif // nsPK11TokenDB_h
|