tor-browser

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

nsPK11TokenDB.h (1701B)


      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 nsPK11TokenDB_h
      8 #define nsPK11TokenDB_h
      9 
     10 #include "nsCOMPtr.h"
     11 #include "nsIPK11Token.h"
     12 #include "nsIPK11TokenDB.h"
     13 #include "nsISupports.h"
     14 #include "nsNSSHelper.h"
     15 #include "nsString.h"
     16 #include "pk11func.h"
     17 #include "ScopedNSSTypes.h"
     18 
     19 class nsPK11Token : public nsIPK11Token {
     20 public:
     21  NS_DECL_ISUPPORTS
     22  NS_DECL_NSIPK11TOKEN
     23 
     24  explicit nsPK11Token(PK11SlotInfo* slot);
     25 
     26 protected:
     27  virtual ~nsPK11Token() = default;
     28 
     29 private:
     30  friend class nsPK11TokenDB;
     31  nsresult refreshTokenInfo();
     32 
     33  nsCString mTokenName;
     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;
     43  int mSeries;
     44  nsCOMPtr<nsIInterfaceRequestor> mUIContext;
     45  nsresult GetAttributeHelper(const nsACString& attribute,
     46                              /*out*/ nsACString& xpcomOutParam);
     47 };
     48 
     49 class nsPK11TokenDB : public nsIPK11TokenDB {
     50 public:
     51  NS_DECL_ISUPPORTS
     52  NS_DECL_NSIPK11TOKENDB
     53 
     54  nsPK11TokenDB() = default;
     55 
     56 protected:
     57  virtual ~nsPK11TokenDB() = default;
     58 };
     59 
     60 #define NS_PK11TOKENDB_CID \
     61  {0xb084a2ce, 0x1dd1, 0x11b2, {0xbf, 0x10, 0x83, 0x24, 0xf8, 0xe0, 0x65, 0xcc}}
     62 
     63 #endif  // nsPK11TokenDB_h