Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
nsPKCS11Slot Class Reference

#include <nsPKCS11Slot.h>

Inheritance diagram for nsPKCS11Slot:
Inheritance graph
[legend]
Collaboration diagram for nsPKCS11Slot:
Collaboration graph
[legend]

List of all members.

Public Types

enum  CalledFromType { calledFromList, calledFromObject }

Public Member Functions

NS_DECL_ISUPPORTS
NS_DECL_NSIPKCS11SLOT 
nsPKCS11Slot (PK11SlotInfo *slot)
virtual ~nsPKCS11Slot ()
nsIPK11Token getToken ()
void shutdown (CalledFromType calledFrom)
PRBool isAlreadyShutDown ()

Public Attributes

readonly attribute wstring name
readonly attribute wstring desc
readonly attribute wstring manID
readonly attribute wstring HWVersion
readonly attribute wstring FWVersion
const unsigned long SLOT_DISABLED = 0
const unsigned long SLOT_NOT_PRESENT = 1
const unsigned long SLOT_UNINITIALIZED = 2
const unsigned long SLOT_NOT_LOGGED_IN = 3
const unsigned long SLOT_LOGGED_IN = 4
const unsigned long SLOT_READY = 5
readonly attribute unsigned long status
readonly attribute wstring tokenName

Private Member Functions

virtual void virtualDestroyNSSReference ()
void destructorSafeDestroyNSSReference ()
void refreshSlotInfo ()

Private Attributes

PK11SlotInfo * mSlot
nsString mSlotDesc
nsString mSlotManID
nsString mSlotHWVersion
nsString mSlotFWVersion
int mSeries

Detailed Description

Definition at line 52 of file nsPKCS11Slot.h.


Member Enumeration Documentation

Enumerator:
calledFromList 
calledFromObject 

Definition at line 270 of file nsNSSShutDown.h.


Constructor & Destructor Documentation

nsPKCS11Slot::nsPKCS11Slot ( PK11SlotInfo *  slot)

Definition at line 55 of file nsPKCS11Slot.cpp.

Here is the call graph for this function:

Definition at line 100 of file nsPKCS11Slot.cpp.

Here is the call graph for this function:


Member Function Documentation

Definition at line 115 of file nsPKCS11Slot.cpp.

{
  if (isAlreadyShutDown())
    return;

  if (mSlot) {
    PK11_FreeSlot(mSlot);
    mSlot = nsnull;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 298 of file nsNSSShutDown.h.

{ return mAlreadyShutDown; }

Here is the caller graph for this function:

Definition at line 68 of file nsPKCS11Slot.cpp.

{
  CK_SLOT_INFO slot_info;
  if (PK11_GetSlotInfo(mSlot, &slot_info) == SECSuccess) {
    // Set the Description field
    const char *ccDesc = (const char*)slot_info.slotDescription;
    const nsACString &cDesc = Substring(
      ccDesc, 
      ccDesc+PL_strnlen(ccDesc, sizeof(slot_info.slotDescription)));
    mSlotDesc = NS_ConvertUTF8toUCS2(cDesc);
    mSlotDesc.Trim(" ", PR_FALSE, PR_TRUE);
    // Set the Manufacturer field
    const char *ccManID = (const char*)slot_info.manufacturerID;
    const nsACString &cManID = Substring(
      ccManID, 
      ccManID+PL_strnlen(ccManID, sizeof(slot_info.manufacturerID)));
    mSlotManID = NS_ConvertUTF8toUCS2(cManID);
    mSlotManID.Trim(" ", PR_FALSE, PR_TRUE);
    // Set the Hardware Version field
    mSlotHWVersion = EmptyString();
    mSlotHWVersion.AppendInt(slot_info.hardwareVersion.major);
    mSlotHWVersion.AppendLiteral(".");
    mSlotHWVersion.AppendInt(slot_info.hardwareVersion.minor);
    // Set the Firmware Version field
    mSlotFWVersion = EmptyString();
    mSlotFWVersion.AppendInt(slot_info.firmwareVersion.major);
    mSlotFWVersion.AppendLiteral(".");
    mSlotFWVersion.AppendInt(slot_info.firmwareVersion.minor);
  }

}

Here is the call graph for this function:

void nsNSSShutDownObject::shutdown ( CalledFromType  calledFrom) [inline, inherited]

Definition at line 285 of file nsNSSShutDown.h.

  {
    if (!mAlreadyShutDown) {
      if (calledFromObject == calledFrom) {
        nsNSSShutDownList::forget(this);
      }
      if (calledFromList == calledFrom) {
        virtualDestroyNSSReference();
      }
      mAlreadyShutDown = PR_TRUE;
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Implements nsNSSShutDownObject.

Definition at line 110 of file nsPKCS11Slot.cpp.

Here is the call graph for this function:


Member Data Documentation

readonly attribute wstring nsIPKCS11Slot::desc [inherited]

Definition at line 48 of file nsIPKCS11Slot.idl.

readonly attribute wstring nsIPKCS11Slot::FWVersion [inherited]

Definition at line 51 of file nsIPKCS11Slot.idl.

readonly attribute wstring nsIPKCS11Slot::HWVersion [inherited]

Definition at line 50 of file nsIPKCS11Slot.idl.

readonly attribute wstring nsIPKCS11Slot::manID [inherited]

Definition at line 49 of file nsIPKCS11Slot.idl.

Definition at line 66 of file nsPKCS11Slot.h.

PK11SlotInfo* nsPKCS11Slot::mSlot [private]

Definition at line 64 of file nsPKCS11Slot.h.

Definition at line 65 of file nsPKCS11Slot.h.

Definition at line 65 of file nsPKCS11Slot.h.

Definition at line 65 of file nsPKCS11Slot.h.

Definition at line 65 of file nsPKCS11Slot.h.

readonly attribute wstring nsIPKCS11Slot::name [inherited]

Definition at line 47 of file nsIPKCS11Slot.idl.

const unsigned long nsIPKCS11Slot::SLOT_DISABLED = 0 [inherited]

Definition at line 53 of file nsIPKCS11Slot.idl.

const unsigned long nsIPKCS11Slot::SLOT_LOGGED_IN = 4 [inherited]

Definition at line 57 of file nsIPKCS11Slot.idl.

const unsigned long nsIPKCS11Slot::SLOT_NOT_LOGGED_IN = 3 [inherited]

Definition at line 56 of file nsIPKCS11Slot.idl.

const unsigned long nsIPKCS11Slot::SLOT_NOT_PRESENT = 1 [inherited]

Definition at line 54 of file nsIPKCS11Slot.idl.

const unsigned long nsIPKCS11Slot::SLOT_READY = 5 [inherited]

Definition at line 58 of file nsIPKCS11Slot.idl.

const unsigned long nsIPKCS11Slot::SLOT_UNINITIALIZED = 2 [inherited]

Definition at line 55 of file nsIPKCS11Slot.idl.

readonly attribute unsigned long nsIPKCS11Slot::status [inherited]

Definition at line 59 of file nsIPKCS11Slot.idl.

readonly attribute wstring nsIPKCS11Slot::tokenName [inherited]

Definition at line 68 of file nsIPKCS11Slot.idl.


The documentation for this class was generated from the following files: