package pkcs11-driver
Module Pkcs11_typesSource
The bindings come in two flavours. The first one is the Direct mode, in which each function from the PKCS11.h header are binded directly. The second one is the Indirect mode, in which we use an indirection through the list of function returned by GetFunctionList.
Types used in the API
CONVENTIONS.
_t is a type variable used to constrain the Ctypes representation. It appears in Pkcs11.CK_VERSION, for instance. However, only t is exported, which is defined as _t structure. For some modules, it is quite easy to work with t seen as an abstract type. For other modules, the higher-level type such as P11.Version.t is more practical.
Where appropriate, we provide the following functions:
create: unit -> Pkcs11.CK_x.t: Allocate a new object of type t (possibly, not initialized).allocate: Pkcs11.CK_x.t -> unit: Update the object in place by allocating memory for its various fields.view: Pkcs11.CK_x.t -> P11.X.t: Build the high-level version of the data represented by the argument.make: P11.X.t -> Pkcs11.CK_x.t: Build the Ctypes version of the data represented byP11.X.t.
N.B. The last two functions raise the question of why we are not using Ctypes views. The problem is that for some functions of the PKCS#11 interface, we have to make several calls to the API to build a proper Pkcs11.CK_x.t, that could then be used to build a P11.X.t.
module CK_DES_CBC_ENCRYPT_DATA_PARAMS =
Pkcs11_CBC_ENCRYPT_DATA_PARAMS.CK_DES_CBC_ENCRYPT_DATA_PARAMSmodule CK_AES_CBC_ENCRYPT_DATA_PARAMS =
Pkcs11_CBC_ENCRYPT_DATA_PARAMS.CK_AES_CBC_ENCRYPT_DATA_PARAMSmodule CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE =
Pkcs11_CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPEval ck_pkcs5_pbkd2_pseudo_random_function_type :
CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE.t Ctypes.typ