CK_TOKEN_INFO_PTR is a pointer to a CK_TOKEN_INFO.
8.3. Session types
Cryptoki represents session information with the following types:
CK_SESSION_HANDLE; CK_SESSION_HANDLE_PTR
CK_SESSION_HANDLE is a Cryptoki-assigned value that identifies a session. It is defined as follows:
typedef CK_ULONG CK_SESSION_HANDLE;
Valid session handles in Cryptoki always have nonzero values. For developers’ convenience, Cryptoki defines the following symbolic value:
#define CK_INVALID_HANDLE 0
CK_SESSION_HANDLE_PTR is a pointer to a CK_SESSION_HANDLE.
CK_USER_TYPE holds the types of Cryptoki users described in Section . It is defined as follows:
typedef CK_ULONG CK_USER_TYPE;
For this version of Cryptoki, the following types of users are defined:
#define CKU_SO 0
#define CKU_USER 1
CK_STATE holds the session state, as described in Sections and . It is defined as follows:
typedef CK_ULONG CK_STATE;
For this version of Cryptoki, the following session states are defined:
#define CKS_RO_PUBLIC_SESSION 0
#define CKS_RO_USER_FUNCTIONS 1
#define CKS_RW_PUBLIC_SESSION 2
#define CKS_RW_USER_FUNCTIONS 3
#define CKS_RW_SO_FUNCTIONS 4
CK_SESSION_INFO; CK_SESSION_INFO_PTR
CK_SESSION_INFO provides information about a session. It is defined as follows:
typedef struct CK_SESSION_INFO {
CK_SLOT_ID slotID;
CK_STATE state;
CK_FLAGS flags;
CK_ULONG ulDeviceError;
} CK_SESSION_INFO;
The fields of the structure have the following meanings:
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 11, Session Information Flags
Share with your friends: |