1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef nsPK11TokenDB_h
8 #define nsPK11TokenDB_h
11 #include "nsIPK11Token.h"
12 #include "nsIPK11TokenDB.h"
13 #include "nsISupports.h"
14 #include "nsNSSHelper.h"
17 #include "ScopedNSSTypes.h"
19 class nsPK11Token
: public nsIPK11Token
{
24 explicit nsPK11Token(PK11SlotInfo
* slot
);
27 virtual ~nsPK11Token() = default;
30 friend class nsPK11TokenDB
;
31 nsresult
refreshTokenInfo();
34 nsCString mTokenManufacturerID
;
35 nsCString mTokenHWVersion
;
36 nsCString mTokenFWVersion
;
37 nsCString mTokenSerialNum
;
38 mozilla::UniquePK11SlotInfo mSlot
;
39 // True if this is the "PKCS#11 token" that provides cryptographic functions.
40 bool mIsInternalCryptoToken
;
41 // True if this is the "PKCS#11 token" where private keys are stored.
42 bool mIsInternalKeyToken
;
44 nsCOMPtr
<nsIInterfaceRequestor
> mUIContext
;
45 nsresult
GetAttributeHelper(const nsACString
& attribute
,
46 /*out*/ nsACString
& xpcomOutParam
);
49 class nsPK11TokenDB
: public nsIPK11TokenDB
{
52 NS_DECL_NSIPK11TOKENDB
54 nsPK11TokenDB() = default;
57 virtual ~nsPK11TokenDB() = default;
60 #define NS_PK11TOKENDB_CID \
62 0xb084a2ce, 0x1dd1, 0x11b2, { \
63 0xbf, 0x10, 0x83, 0x24, 0xf8, 0xe0, 0x65, 0xcc \
67 #endif // nsPK11TokenDB_h