Module type Pkcs11.LOW_LEVEL_WRAPPER
A low-level wrapper wraps low-level bindings. Only functions in the PKCS#11 interface are available. Functions expect to mostly take and return CK_* types, but some arguments are named, use ocaml builtin types or are removed for convenience (for example the void ptr used by c_Initialize is replaced by unit).
For low-level bindings that expect to be passed empty structures to populate, the wrapper functions will allocate and initialize the structures as appropriate so the caller does not have to.
val c_Initialize : Nss_initialize_arg.t option -> CK_RV.t
val c_Finalize : unit -> CK_RV.t
val c_GetInfo : unit -> CK_RV.t * P11_info.t
val c_GetSlotList : bool -> Slot_list.t -> CK_RV.t
val c_GetSlotInfo : slot:CK_SLOT_ID.t -> CK_RV.t * P11_slot_info.t
val c_GetTokenInfo : slot:CK_SLOT_ID.t -> CK_RV.t * P11_token_info.t
val c_GetMechanismList : slot:CK_SLOT_ID.t -> Mechanism_list.t -> CK_RV.t
val c_GetMechanismInfo : slot:CK_SLOT_ID.t -> CK_MECHANISM_TYPE.t -> CK_RV.t * P11_mechanism_info.t
val c_InitToken : slot:CK_SLOT_ID.t -> pin:string -> label:string -> CK_RV.t
val c_InitPIN : CK_SESSION_HANDLE.t -> string -> CK_RV.t
val c_SetPIN : CK_SESSION_HANDLE.t -> oldpin:string -> newpin:string -> CK_RV.t
val c_OpenSession : slot:CK_SLOT_ID.t -> flags:CK_FLAGS.t -> CK_RV.t * CK_SESSION_HANDLE.t
val c_CloseSession : CK_SESSION_HANDLE.t -> CK_RV.t
val c_CloseAllSessions : slot:CK_SLOT_ID.t -> CK_RV.t
val c_GetSessionInfo : CK_SESSION_HANDLE.t -> CK_RV.t * P11_session_info.t
val c_Login : CK_SESSION_HANDLE.t -> CK_USER_TYPE.t -> string -> CK_RV.t
val c_Logout : CK_SESSION_HANDLE.t -> CK_RV.t
val c_CreateObject : CK_SESSION_HANDLE.t -> Template.t -> CK_RV.t * CK_OBJECT_HANDLE.t
val c_CopyObject : CK_SESSION_HANDLE.t -> CK_OBJECT_HANDLE.t -> Template.t -> CK_RV.t * CK_OBJECT_HANDLE.t
val c_DestroyObject : CK_SESSION_HANDLE.t -> CK_OBJECT_HANDLE.t -> CK_RV.t
val c_GetAttributeValue : CK_SESSION_HANDLE.t -> CK_OBJECT_HANDLE.t -> Template.t -> CK_RV.t
val c_SetAttributeValue : CK_SESSION_HANDLE.t -> CK_OBJECT_HANDLE.t -> Template.t -> CK_RV.t
val c_FindObjectsInit : CK_SESSION_HANDLE.t -> Template.t -> CK_RV.t
val c_FindObjects : CK_SESSION_HANDLE.t -> max_size:int -> CK_RV.t * CK_OBJECT_HANDLE.t list
val c_FindObjectsFinal : CK_SESSION_HANDLE.t -> CK_RV.t
val c_EncryptInit : CK_SESSION_HANDLE.t -> CK_MECHANISM.t -> CK_OBJECT_HANDLE.t -> CK_RV.t
val c_Encrypt : CK_SESSION_HANDLE.t -> src:Data.t -> tgt:Data.t -> CK_RV.t
val c_EncryptUpdate : CK_SESSION_HANDLE.t -> Data.t -> Data.t -> CK_RV.t
val c_EncryptFinal : CK_SESSION_HANDLE.t -> Data.t -> CK_RV.t
val c_DecryptInit : CK_SESSION_HANDLE.t -> CK_MECHANISM.t -> CK_OBJECT_HANDLE.t -> CK_RV.t
val c_Decrypt : CK_SESSION_HANDLE.t -> src:Data.t -> tgt:Data.t -> CK_RV.t
val c_DecryptUpdate : CK_SESSION_HANDLE.t -> Data.t -> Data.t -> CK_RV.t
val c_DecryptFinal : CK_SESSION_HANDLE.t -> Data.t -> CK_RV.t
val c_DigestInit : CK_SESSION_HANDLE.t -> CK_MECHANISM.t -> CK_RV.t
val c_Digest : CK_SESSION_HANDLE.t -> Data.t -> Data.t -> CK_RV.t
val c_DigestUpdate : CK_SESSION_HANDLE.t -> Data.t -> CK_RV.t
val c_DigestKey : CK_SESSION_HANDLE.t -> CK_OBJECT_HANDLE.t -> CK_RV.t
val c_DigestFinal : CK_SESSION_HANDLE.t -> Data.t -> CK_RV.t
val c_SignInit : CK_SESSION_HANDLE.t -> CK_MECHANISM.t -> CK_OBJECT_HANDLE.t -> CK_RV.t
val c_Sign : CK_SESSION_HANDLE.t -> src:Data.t -> tgt:Data.t -> CK_RV.t
val c_SignUpdate : CK_SESSION_HANDLE.t -> Data.t -> CK_RV.t
val c_SignFinal : CK_SESSION_HANDLE.t -> Data.t -> CK_RV.t
val c_SignRecoverInit : CK_SESSION_HANDLE.t -> CK_MECHANISM.t -> CK_OBJECT_HANDLE.t -> CK_RV.t
val c_SignRecover : CK_SESSION_HANDLE.t -> src:Data.t -> tgt:Data.t -> CK_RV.t
val c_VerifyInit : CK_SESSION_HANDLE.t -> CK_MECHANISM.t -> CK_OBJECT_HANDLE.t -> CK_RV.t
val c_Verify : CK_SESSION_HANDLE.t -> signed:Data.t -> signature:Data.t -> CK_RV.t
val c_VerifyUpdate : CK_SESSION_HANDLE.t -> Data.t -> CK_RV.t
val c_VerifyFinal : CK_SESSION_HANDLE.t -> Data.t -> CK_RV.t
val c_VerifyRecoverInit : CK_SESSION_HANDLE.t -> CK_MECHANISM.t -> CK_OBJECT_HANDLE.t -> CK_RV.t
val c_VerifyRecover : CK_SESSION_HANDLE.t -> signature:Data.t -> signed:Data.t -> CK_RV.t
val c_DigestEncryptUpdate : CK_SESSION_HANDLE.t -> src:Data.t -> tgt:Data.t -> CK_RV.t
val c_DecryptDigestUpdate : CK_SESSION_HANDLE.t -> src:Data.t -> tgt:Data.t -> CK_RV.t
val c_SignEncryptUpdate : CK_SESSION_HANDLE.t -> src:Data.t -> tgt:Data.t -> CK_RV.t
val c_DecryptVerifyUpdate : CK_SESSION_HANDLE.t -> src:Data.t -> tgt:Data.t -> CK_RV.t
Key Management
val c_GenerateKey : CK_SESSION_HANDLE.t -> CK_MECHANISM.t -> Template.t -> CK_RV.t * CK_OBJECT_HANDLE.t
val c_GenerateKeyPair : CK_SESSION_HANDLE.t -> CK_MECHANISM.t -> public:Template.t -> privat:Template.t -> CK_RV.t * CK_OBJECT_HANDLE.t * CK_OBJECT_HANDLE.t
val c_WrapKey : CK_SESSION_HANDLE.t -> CK_MECHANISM.t -> wrapping_key:CK_OBJECT_HANDLE.t -> key:CK_OBJECT_HANDLE.t -> wrapped_key:Data.t -> CK_RV.t
val c_UnwrapKey : CK_SESSION_HANDLE.t -> CK_MECHANISM.t -> unwrapping_key:CK_OBJECT_HANDLE.t -> wrapped_key:Data.t -> Template.t -> CK_RV.t * CK_OBJECT_HANDLE.t
val c_DeriveKey : CK_SESSION_HANDLE.t -> CK_MECHANISM.t -> CK_OBJECT_HANDLE.t -> Template.t -> CK_RV.t * CK_OBJECT_HANDLE.t