package pkcs11-driver

  1. Overview
  2. Docs
Bindings to the PKCS#11 cryptographic API

Install

Dune Dependency

Authors

Maintainers

Sources

pkcs11-v1.0.0.tbz
sha256=eee2e67fff116d747d1d0f6229af9e952cbb4f9a56765c069c63c1e1bbbc67a3
sha512=3a1090b0cd53b09dffb4c2a2d591e290ff3fe9add1217797f9746a1a6af0d41239b217f1dd45354e3ee457ff007d68bb4d8d83f07001d6ad9870e7aaba4fd434

doc/pkcs11-driver/Pkcs11_types/index.html

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 by P11.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.

Sourcemodule CK_ULONG = P11_ulong
Sourcemodule CK_BYTE = Pkcs11_CK_BYTE
Sourcemodule CK_BBOOL = Pkcs11_CK_BBOOL
Sourcemodule CK_UTF8CHAR = Pkcs11_CK_UTF8CHAR
Sourcemodule CK_VOID = Pkcs11_CK_VOID
Sourcemodule CK_FLAGS = Pkcs11_CK_FLAGS
Sourcemodule Data = Pkcs11_data
Sourcemodule CK_OBJECT_CLASS = Pkcs11_CK_OBJECT_CLASS
Sourcemodule CK_KEY_TYPE = Pkcs11_CK_KEY_TYPE
Sourcemodule CK_VERSION = Pkcs11_CK_VERSION
Sourcemodule CK_SESSION_HANDLE = Pkcs11_CK_SESSION_HANDLE
Sourcemodule CK_OBJECT_HANDLE = Pkcs11_CK_OBJECT_HANDLE
Sourcemodule CK_HW_FEATURE_TYPE = Pkcs11_CK_HW_FEATURE_TYPE
Sourcemodule CK_SLOT_ID = Pkcs11_CK_SLOT_ID
Sourcemodule CK_SLOT_INFO = Pkcs11_CK_SLOT_INFO
Sourcemodule Slot_list = Pkcs11_slot_list
Sourcemodule CK_MECHANISM_INFO = Pkcs11_CK_MECHANISM_INFO
Sourcemodule CK_SESSION_INFO = Pkcs11_CK_SESSION_INFO
Sourcemodule CK_BIGINT = P11_bigint
Sourcemodule CK_RV = Pkcs11_CK_RV
Sourcemodule CK_MECHANISM_TYPE = Pkcs11_CK_MECHANISM_TYPE
Sourcemodule Key_gen_mechanism = Pkcs11_key_gen_mechanism
Sourcemodule CK_RSA_PKCS_MGF_TYPE = Pkcs11_CK_RSA_PKCS_MGF_TYPE
Sourcemodule CK_RSA_PKCS_OAEP_PARAMS = Pkcs11_CK_RSA_PKCS_OAEP_PARAMS
Sourcemodule CK_RSA_PKCS_PSS_PARAMS = Pkcs11_CK_RSA_PKCS_PSS_PARAMS
Sourcemodule CK_KEY_DERIVATION_STRING_DATA = Pkcs11_CK_KEY_DERIVATION_STRING_DATA
Sourcemodule CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE = Pkcs11_CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE
Sourcemodule CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE = Pkcs11_CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE
Sourcemodule CK_PKCS5_PBKD2_PARAMS = Pkcs11_CK_PKCS5_PBKD2_PARAMS
Sourcemodule CK_EC_KDF_TYPE = Pkcs11_CK_EC_KDF_TYPE
Sourcemodule CK_ECDH1_DERIVE_PARAMS = Pkcs11_CK_ECDH1_DERIVE_PARAMS
Sourcemodule CK_ECMQV_DERIVE_PARAMS = Pkcs11_CK_ECMQV_DERIVE_PARAMS
Sourcemodule CK_MECHANISM = Pkcs11_CK_MECHANISM
Sourcemodule CK_USER_TYPE = Pkcs11_CK_USER_TYPE
Sourcemodule CK_INFO = Pkcs11_CK_INFO
Sourcemodule CK_TOKEN_INFO = Pkcs11_CK_TOKEN_INFO
Sourcemodule CK_ATTRIBUTE_TYPE = Pkcs11_CK_ATTRIBUTE_TYPE
Sourcemodule CK_ATTRIBUTE = Pkcs11_CK_ATTRIBUTE
Sourcemodule Template = Pkcs11_template
Sourcemodule Mechanism_list = Pkcs11_mechanism_list
Sourcemodule CK_ATTRIBUTE_SET = Pkcs11_CK_ATTRIBUTE_SET
Sourcemodule CK_AES_CTR_PARAMS = Pkcs11_CK_AES_CTR_PARAMS
Sourcemodule CK_GCM_PARAMS = Pkcs11_CK_GCM_PARAMS
Sourceval ck_utf8char : char Ctypes.typ
Sourceval ck_object_class : CK_OBJECT_CLASS.t Ctypes.typ
Sourceval ck_session_handle : CK_SESSION_HANDLE.t Ctypes.typ
Sourceval ck_object_handle : CK_OBJECT_HANDLE.t Ctypes.typ
Sourceval ck_hw_feature_type : CK_HW_FEATURE_TYPE.t Ctypes.typ
Sourceval ck_slot_info : CK_SLOT_INFO.t Ctypes.typ
Sourceval ck_mechanism_info : CK_MECHANISM_INFO.t Ctypes.typ
Sourceval ck_session_info : CK_SESSION_INFO.t Ctypes.typ
Sourceval ck_mechanism_type : CK_MECHANISM_TYPE.t Ctypes.typ
Sourceval ck_rsa_pkcs_mgf_type : CK_RSA_PKCS_MGF_TYPE.t Ctypes.typ
Sourceval ck_pkcs5_pbkdf2_salt_source_type : CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE.t Ctypes.typ
Sourceval ck_pkcs5_pbkd2_pseudo_random_function_type : CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE.t Ctypes.typ
Sourceval ck_mechanism : CK_MECHANISM.t Ctypes.typ
Sourceval ck_user_type : CK_USER_TYPE.t Ctypes.typ
Sourceval ck_token_info : CK_TOKEN_INFO.t Ctypes.typ
Sourceval ck_attribute_type : CK_ATTRIBUTE_TYPE.t Ctypes.typ
Sourceval ck_attribute : CK_ATTRIBUTE.t Ctypes.typ
Sourcetype template = Template.t
Sourcemodule Initialize_arg : sig ... end
Sourcemodule Nss_initialize_arg : sig ... end
Sourcetype _ck_function_list
Sourceval ck_function_list : ck_function_list Ctypes.typ
Sourcemodule CK_NOTIFY : sig ... end
Sourcemodule CK : sig ... end
Sourcemodule CK_FUNCTION_LIST : sig ... end
OCaml

Innovation. Community. Security.