Cryptoki: a cryptographic Token Interface



Download 360.55 Kb.
Page29/196
Date22.12.2023
Size360.55 Kb.
#63026
1   ...   25   26   27   28   29   30   31   32   ...   196
v201-95
pkcs11-base-v2.40-cos01
Bit Flag

Mask

Meaning

CKF_TOKEN_PRESENT

0x00000001

TRUE if a token is present in the slot (e.g., a device is in the reader)

CKF_REMOVABLE_DEVICE

0x00000002

TRUE if the reader supports removable devices

CKF_HW_SLOT

0x00000004

TRUE if the slot is a hardware slot, as opposed to a software slot implementing a “soft token”

For a given slot, the value of the CKF_REMOVABLE_DEVICE flag never changes. In addition, if this flag is not set for a given slot, then the CKF_TOKEN_PRESENT flag for that slot is always set. That is, if a slot does not support a removable device, then that slot always has a token in it.


CK_SLOT_INFO_PTR is a pointer to a CK_SLOT_INFO.
  • CK_TOKEN_INFO; CK_TOKEN_INFO_PTR


CK_TOKEN_INFO provides information about a token. It is defined as follows:
typedef struct CK_TOKEN_INFO {
CK_CHAR label[32];
CK_CHAR manufacturerID[32];
CK_CHAR model[16];
CK_CHAR serialNumber[16];
CK_FLAGS flags;
CK_ULONG ulMaxSessionCount;
CK_ULONG ulSessionCount;
CK_ULONG ulMaxRwSessionCount;
CK_ULONG ulRwSessionCount;
CK_ULONG ulMaxPinLen;
CK_ULONG ulMinPinLen;
CK_ULONG ulTotalPublicMemory;
CK_ULONG ulFreePublicMemory;
CK_ULONG ulTotalPrivateMemory;
CK_ULONG ulFreePrivateMemory;
CK_VERSION hardwareVersion;
CK_VERSION firmwareVersion;
CK_CHAR utcTime[16];
} CK_TOKEN_INFO;

The fields of the structure have the following meanings:


label application-defined label, assigned during token initialization. Must be padded with the blank character (‘ ‘). Should not be null-terminated.
manufacturerID ID of the device manufacturer. Must be padded with the blank character (‘ ‘). Should not be null-terminated.
model model of the device. Must be padded with the blank character (‘ ‘). Should not be null-terminated.
serialNumber character-string serial number of the device. Must be padded with the blank character (‘ ‘). Should not be null-terminated.
flags bit flags indicating capabilities and status of the device as defined below
ulMaxSessionCount maximum number of sessions that can be opened with the token at one time by a single application (see note below)
ulSessionCount number of sessions that this application currently has open with the token (see note below)
ulMaxRwSessionCount maximum number of read/write sessions that can be opened with the token at one time by a single application (see note below)
ulRwSessionCount number of read/write sessions that this application currently has open with the token (see note below)
ulMaxPinLen maximum length in bytes of the PIN
ulMinPinLen minimum length in bytes of the PIN
ulTotalPublicMemory the total amount of memory on the token in bytes in which public objects may be stored (see note below)
ulFreePublicMemory the amount of free (unused) memory on the token in bytes for public objects (see note below)
ulTotalPrivateMemory the total amount of memory on the token in bytes in which private objects may be stored (see note below)
ulFreePrivateMemory the amount of free (unused) memory on the token in bytes for private objects (see note below)
hardwareVersion version number of hardware
firmwareVersion version number of firmware
utcTime current time as a character-string of length 16, represented in the format YYYYMMDDhhmmssxx (4 characters for the year; 2 characters each for the month, the day, the hour, the minute, and the second; and 2 additional reserved ‘0’ characters). The value of this field only makes sense for tokens equipped with a clock, as indicated in the token information flags (see Table 10)
The following table defines the flags field:
Table 10, Token Information Flags


Download 360.55 Kb.

Share with your friends:
1   ...   25   26   27   28   29   30   31   32   ...   196




The database is protected by copyright ©ininet.org 2024
send message

    Main page