![]() | Cryptographic Token Interface Standard |
PKCS#11 |
Cryptoki represents session information with the following types:
typedef CK_ULONG CK_SESSION_HANDLE;
Valid session handles in Cryptoki always have nonzero values. For developers' convenience, Cryptoki defines the following symbolic value:
CK_SESSION_HANDLE_PTR is a pointer to a CK_SESSION_HANDLE.
typedef CK_ULONG CK_USER_TYPE;
For this version of Cryptoki, the following types of users are defined:
For this version of Cryptoki, the following session states are defined:
CKS_RO_PUBLIC_SESSION CKS_RO_USER_FUNCTIONS CKS_RW_PUBLIC_SESSION CKS_RW_USER_FUNCTIONS CKS_RW_SO_FUNCTIONS
typedef struct CK_SESSION_INFO { CK_SLOT_ID slotID; CK_STATE state; CK_FLAGS flags; CK_ULONG ulDeviceError; } CK_SESSION_INFO;
slotID | ID of the slot that interfaces with the token |
state | the state of the session |
flags | bit flags that define the type of session; the flags are defined below |
ulDeviceError | an error code defined by the cryptographic device. Used for errors not covered by Cryptoki. |
The following table defines the flags field:
Table 12, Session Information Flags
Bit Flag | Mask | Meaning |
CKF_RW_SESSION | 0x00000002 | True if the session is read/write; false if the session is read-only |
CKF_SERIAL_SESSION | 0x00000004 | This flag is provided for backward compatibility, and should always be set to true |
CK_SESSION_INFO_PTR is a pointer to a CK_SESSION_INFO.