Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/security/manager/ssl/nsPK11TokenDB.h
Line
Count
Source (jump to first uncovered line)
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
{
21
public:
22
  NS_DECL_ISUPPORTS
23
  NS_DECL_NSIPK11TOKEN
24
25
  explicit nsPK11Token(PK11SlotInfo *slot);
26
27
protected:
28
0
  virtual ~nsPK11Token() {}
29
30
private:
31
  friend class nsPK11TokenDB;
32
  nsresult refreshTokenInfo();
33
34
  nsCString mTokenName;
35
  nsCString mTokenManufacturerID;
36
  nsCString mTokenHWVersion;
37
  nsCString mTokenFWVersion;
38
  nsCString mTokenSerialNum;
39
  mozilla::UniquePK11SlotInfo mSlot;
40
  // True if this is the "PKCS#11 token" that provides cryptographic functions.
41
  bool mIsInternalCryptoToken;
42
  // True if this is the "PKCS#11 token" where private keys are stored.
43
  bool mIsInternalKeyToken;
44
  int mSeries;
45
  nsCOMPtr<nsIInterfaceRequestor> mUIContext;
46
  nsresult GetAttributeHelper(const nsACString& attribute,
47
                      /*out*/ nsACString& xpcomOutParam);
48
};
49
50
class nsPK11TokenDB : public nsIPK11TokenDB
51
{
52
public:
53
  NS_DECL_ISUPPORTS
54
  NS_DECL_NSIPK11TOKENDB
55
56
0
  nsPK11TokenDB() {}
57
58
protected:
59
0
  virtual ~nsPK11TokenDB() {}
60
};
61
62
#define NS_PK11TOKENDB_CID \
63
{ 0xb084a2ce, 0x1dd1, 0x11b2, \
64
  { 0xbf, 0x10, 0x83, 0x24, 0xf8, 0xe0, 0x65, 0xcc }}
65
66
#endif // nsPK11TokenDB_h