package pkcs11-driver
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=eee2e67fff116d747d1d0f6229af9e952cbb4f9a56765c069c63c1e1bbbc67a3
sha512=3a1090b0cd53b09dffb4c2a2d591e290ff3fe9add1217797f9746a1a6af0d41239b217f1dd45354e3ee457ff007d68bb4d8d83f07001d6ad9870e7aaba4fd434
doc/pkcs11-driver/Pkcs11_types/index.html
Module Pkcs11_types
Source
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_PARAMS
module CK_AES_CBC_ENCRYPT_DATA_PARAMS =
Pkcs11_CBC_ENCRYPT_DATA_PARAMS.CK_AES_CBC_ENCRYPT_DATA_PARAMS
module CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE =
Pkcs11_CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE
val ck_pkcs5_pbkd2_pseudo_random_function_type :
CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE.t Ctypes.typ