|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
|
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/. */ |
|
6 |
|
7 #ifndef __NS_PKCS11SLOT_H__ |
|
8 #define __NS_PKCS11SLOT_H__ |
|
9 |
|
10 #include "nsISupports.h" |
|
11 #include "nsIPKCS11Slot.h" |
|
12 #include "nsIPKCS11Module.h" |
|
13 #include "nsIPKCS11ModuleDB.h" |
|
14 #include "nsICryptoFIPSInfo.h" |
|
15 #include "nsString.h" |
|
16 #include "pk11func.h" |
|
17 #include "nsNSSShutDown.h" |
|
18 |
|
19 class nsPKCS11Slot : public nsIPKCS11Slot, |
|
20 public nsNSSShutDownObject |
|
21 { |
|
22 public: |
|
23 NS_DECL_ISUPPORTS |
|
24 NS_DECL_NSIPKCS11SLOT |
|
25 |
|
26 nsPKCS11Slot(PK11SlotInfo *slot); |
|
27 virtual ~nsPKCS11Slot(); |
|
28 |
|
29 private: |
|
30 |
|
31 PK11SlotInfo *mSlot; |
|
32 nsString mSlotDesc, mSlotManID, mSlotHWVersion, mSlotFWVersion; |
|
33 int mSeries; |
|
34 |
|
35 virtual void virtualDestroyNSSReference(); |
|
36 void destructorSafeDestroyNSSReference(); |
|
37 void refreshSlotInfo(); |
|
38 }; |
|
39 |
|
40 class nsPKCS11Module : public nsIPKCS11Module, |
|
41 public nsNSSShutDownObject |
|
42 { |
|
43 public: |
|
44 NS_DECL_ISUPPORTS |
|
45 NS_DECL_NSIPKCS11MODULE |
|
46 |
|
47 nsPKCS11Module(SECMODModule *module); |
|
48 virtual ~nsPKCS11Module(); |
|
49 |
|
50 private: |
|
51 SECMODModule *mModule; |
|
52 |
|
53 virtual void virtualDestroyNSSReference(); |
|
54 void destructorSafeDestroyNSSReference(); |
|
55 }; |
|
56 |
|
57 class nsPKCS11ModuleDB : public nsIPKCS11ModuleDB, |
|
58 public nsICryptoFIPSInfo |
|
59 { |
|
60 public: |
|
61 NS_DECL_ISUPPORTS |
|
62 NS_DECL_NSIPKCS11MODULEDB |
|
63 NS_DECL_NSICRYPTOFIPSINFO |
|
64 |
|
65 nsPKCS11ModuleDB(); |
|
66 virtual ~nsPKCS11ModuleDB(); |
|
67 /* additional members */ |
|
68 }; |
|
69 |
|
70 #define NS_PKCS11MODULEDB_CID \ |
|
71 { 0xff9fbcd7, 0x9517, 0x4334, \ |
|
72 { 0xb9, 0x7a, 0xce, 0xed, 0x78, 0x90, 0x99, 0x74 }} |
|
73 |
|
74 #endif |