Prefix
|
Description
|
C_
|
Function
|
CK_
|
Data type or general constant
|
CKA_
|
Attribute
|
CKC_
|
Certificate type
|
CKF_
|
Bit flag
|
CKK_
|
Key type
|
CKM_
|
Mechanism type
|
CKN_
|
Notification
|
CKO_
|
Object class
|
CKS_
|
Session state
|
CKR_
|
Return value
|
CKU_
|
User type
|
h
|
a handle
|
ul
|
a CK_ULONG
|
p
|
a pointer
|
pb
|
a pointer to a CK_BYTE
|
ph
|
a pointer to a handle
|
pul
|
a pointer to a CK_ULONG
|
Cryptoki is based on ANSI C types, and defines the following data types:
/* an unsigned 8-bit value */
typedef unsigned char CK_BYTE;
/* an unsigned 8-bit character */
typedef CK_BYTE CK_CHAR;
/* a BYTE-sized Boolean flag */
typedef CK_BYTE CK_BBOOL;
/* an unsigned value, at least 32 bits long */
typedef unsigned long int CK_ULONG;
/* a signed value, the same size as a CK_ULONG */
typedef long int CK_LONG;
/* at least 32 bits; each bit is a Boolean flag */
typedef CK_ULONG CK_FLAGS;
Cryptoki also uses pointers to some of these data types, as well as to the type void, which are implementation-dependent. These pointer types are:
CK_BYTE_PTR /* Pointer to a CK_BYTE */
CK_CHAR_PTR /* Pointer to a CK_CHAR */
CK_ULONG_PTR /* Pointer to a CK_ULONG */
CK_VOID_PTR /* Pointer to a void */
Cryptoki also defines a pointer to a CK_VOID_PTR, which is implementation-dependent:
CK_VOID_PTR_PTR /* Pointer to a CK_VOID_PTR */
In addition, Cryptoki defines a C-style NULL pointer, which is distinct from any valid pointer:
NULL_PTR /* A NULL pointer */
It follows that many of the data and pointer types will vary somewhat from one environment to another (e.g., a CK_ULONG will sometimes be 32 bits, and sometimes perhaps 64 bits). However, these details should not affect an application, assuming it is compiled with Cryptoki header files consistent with the Cryptoki library to which the application is linked.
All numbers and values expressed in this document are decimal, unless they are preceded by “0x”, in which case they are hexadecimal values.
The CK_CHAR data type holds characters from the following table, taken from ANSI C:
Table 3, Character Set
Share with your friends: |