tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

nsPKCS11Slot.h (1507B)


      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 nsPKCS11Slot_h
      8 #define nsPKCS11Slot_h
      9 
     10 #include "ScopedNSSTypes.h"
     11 #include "nsIPKCS11Module.h"
     12 #include "nsIPKCS11Slot.h"
     13 #include "nsISupports.h"
     14 #include "nsString.h"
     15 #include "pk11func.h"
     16 
     17 class nsPKCS11Slot : public nsIPKCS11Slot {
     18 public:
     19  NS_DECL_ISUPPORTS
     20  NS_DECL_NSIPKCS11SLOT
     21 
     22  explicit nsPKCS11Slot(PK11SlotInfo* slot);
     23 
     24 protected:
     25  virtual ~nsPKCS11Slot() = default;
     26 
     27 private:
     28  mozilla::UniquePK11SlotInfo mSlot;
     29  // True if this is the "PKCS#11 slot" that provides cryptographic functions.
     30  bool mIsInternalCryptoSlot;
     31  // True if this is the "PKCS#11 slot" where private keys are stored.
     32  bool mIsInternalKeySlot;
     33  nsCString mSlotDesc;
     34  nsCString mSlotManufacturerID;
     35  nsCString mSlotHWVersion;
     36  nsCString mSlotFWVersion;
     37  int mSeries;
     38 
     39  nsresult refreshSlotInfo();
     40  nsresult GetAttributeHelper(const nsACString& attribute,
     41                              /*out*/ nsACString& xpcomOutParam);
     42 };
     43 
     44 class nsPKCS11Module : public nsIPKCS11Module {
     45 public:
     46  NS_DECL_ISUPPORTS
     47  NS_DECL_NSIPKCS11MODULE
     48 
     49  explicit nsPKCS11Module(SECMODModule* module);
     50 
     51 protected:
     52  virtual ~nsPKCS11Module() = default;
     53 
     54 private:
     55  mozilla::UniqueSECMODModule mModule;
     56 };
     57 
     58 #endif  // nsPKCS11Slot_h