Cryptoki: a cryptographic Token Interface


CK_MECHANISM; CK_MECHANISM_PTR



Download 360.55 Kb.
Page35/196
Date22.12.2023
Size360.55 Kb.
#63026
1   ...   31   32   33   34   35   36   37   38   ...   196
v201-95
pkcs11-base-v2.40-cos01
CK_MECHANISM_TYPE_PTR is a pointer to a CK_MECHANISM_TYPE.
  • CK_MECHANISM; CK_MECHANISM_PTR


CK_MECHANISM is a structure that specifies a particular mechanism and any parameters it requires. It is defined as follows:
typedef struct CK_MECHANISM {
CK_MECHANISM_TYPE mechanism;
CK_VOID_PTR pParameter;
CK_ULONG ulParameterLen;
} CK_MECHANISM;

The fields of the structure have the following meanings:


mechanism the type of mechanism
pParameter pointer to the parameter if required by the mechanism
ulParameterLen length in bytes of the parameter
Note that pParameter is a “void” pointer, facilitating the passing of arbitrary values. Both the application and the Cryptoki library must ensure that the pointer can be safely cast to the expected type (i.e., without word-alignment errors).
CK_MECHANISM_PTR is a pointer to a CK_MECHANISM.
  • CK_MECHANISM_INFO; CK_MECHANISM_INFO_PTR


CK_MECHANISM_INFO is a structure that provides information about a particular mechanism. It is defined as follows:
typedef struct CK_MECHANISM_INFO {
CK_ULONG ulMinKeySize;
CK_ULONG ulMaxKeySize;
CK_FLAGS flags;
} CK_MECHANISM_INFO;

The fields of the structure have the following meanings:


ulMinKeySize the minimum size of the key for the mechanism (whether this is measured in bits or in bytes is mechanism-dependent)
ulMaxKeySize the maximum size of the key for the mechanism (whether this is measured in bits or in bytes is mechanism-dependent)
flags bit flags specifying mechanism capabilities
For some mechanisms, the ulMinKeySize and ulMaxKeySize fields have meaningless values.
The following table defines the flags field:
Table 12, Mechanism Information Flags


Download 360.55 Kb.

Share with your friends:
1   ...   31   32   33   34   35   36   37   38   ...   196




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

    Main page