Cryptoki: a cryptographic Token Interface



Download 360.55 Kb.
Page39/196
Date22.12.2023
Size360.55 Kb.
#63026
1   ...   35   36   37   38   39   40   41   42   ...   196
v201-95
pkcs11-base-v2.40-cos01
CK_LOCKMUTEX is defined as follows:
typedef CK_CALLBACK_FUNCTION(CK_RV, CK_LOCKMUTEX)(
CK_VOID_PTR pMutex
);

The argument to a CK_LOCKMUTEX function is a pointer to the mutex object to be locked. Such a function should return one of the following values: CKR_OK, CKR_GENERAL_ERROR, CKR_HOST_MEMORY, CKR_MUTEX_BAD.


CK_UNLOCKMUTEX is defined as follows:
typedef CK_CALLBACK_FUNCTION(CK_RV, CK_UNLOCKMUTEX)(
CK_VOID_PTR pMutex
);

The argument to a CK_UNLOCKMUTEX function is a pointer to the mutex object to be unlocked. Such a function should return one of the following values: CKR_OK, CKR_GENERAL_ERROR, CKR_HOST_MEMORY, CKR_MUTEX_BAD, CKR_MUTEX_NOT_LOCKED.


  • CK_C_INITIALIZE_ARGS; CK_C_INITIALIZE_ARGS_PTR


CK_C_INITIALIZE_ARGS is a structure containing the optional arguments for the C_Initialize function. For this version of Cryptoki, these optional arguments are all concerned with the way the library deals with threads. CK_C_INITIALIZE_ARGS is defined as follows:
typedef struct CK_C_INITIALIZE_ARGS {
CK_CREATEMUTEX CreateMutex;
CK_DESTROYMUTEX DestroyMutex;
CK_LOCKMUTEX LockMutex;
CK_UNLOCKMUTEX UnlockMutex;
CK_FLAGS flags;
CK_VOID_PTR pReserved;
} CK_C_INITIALIZE_ARGS;

The fields of the structure have the following meanings:


CreateMutex pointer to a function to use for creating mutex objects
DestroyMutex pointer to a function to use for destroying mutex objects
LockMutex pointer to a function to use for locking mutex objects
UnlockMutex pointer to a function to use for unlocking mutex objects
flags bit flags specifying options for C_Initialize; the flags are defined below
pReserved reserved for future use. Should be NULL_PTR for this version of Cryptoki
The following table defines the flags field:
Table 13, C_Initialize Parameter Flags


Download 360.55 Kb.

Share with your friends:
1   ...   35   36   37   38   39   40   41   42   ...   196




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

    Main page