package pkcs11-driver

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

High-level interface for PKCS#11 bindings. Contains all functions in the PKCS#11 specification as well as helper functions to make working with PKCS#11 easier. All functions take core P11* types (rather than CK_* types), and structure allocation and populate is handled automatically.

val initialize : unit -> unit
val initialize_nss : params:Pkcs11.Nss_initialize_arg.u -> unit
val finalize : unit -> unit
val get_info : unit -> P11.Info.t
val get_slot : P11.Slot.t -> (P11.Slot_id.t, string) result
val get_slot_list : bool -> P11.Slot_id.t list
val get_slot_info : slot:P11.Slot_id.t -> P11.Slot_info.t
val get_token_info : slot:P11.Slot_id.t -> P11.Token_info.t
val get_mechanism_list : slot:P11.Slot_id.t -> P11.Mechanism_type.t list
val get_mechanism_info : slot:P11.Slot_id.t -> P11.Mechanism_type.t -> P11.Mechanism_info.t
val init_token : slot:P11.Slot_id.t -> pin:string -> label:string -> unit
val init_PIN : P11.Session_handle.t -> pin:string -> unit
val set_PIN : P11.Session_handle.t -> oldpin:string -> newpin:string -> unit
val open_session : slot:P11.Slot_id.t -> flags:P11.Flags.t -> P11.Session_handle.t
val close_session : P11.Session_handle.t -> unit
val close_all_sessions : slot:P11.Slot_id.t -> unit
val get_session_info : P11.Session_handle.t -> P11.Session_info.t
val login : P11.Session_handle.t -> P11.User_type.t -> string -> unit
val logout : P11.Session_handle.t -> unit
val destroy_object : P11.Session_handle.t -> P11.Object_handle.t -> unit

May request several attributes at the same time.

Will request attributes one by one.

val get_attribute_value_optimized : P11.Attribute_types.t -> [ `Optimized of P11.Session_handle.t -> P11.Object_handle.t -> P11.Template.t ]

Will request several attributes at the same time. (optimized version)

val set_attribute_value : P11.Session_handle.t -> P11.Object_handle.t -> P11.Template.t -> unit
val find_objects : ?max_size:int -> P11.Session_handle.t -> P11.Template.t -> P11.Object_handle.t list
val multipart_encrypt_init : P11.Session_handle.t -> P11.Mechanism.t -> P11.Object_handle.t -> unit
val multipart_encrypt_chunck : P11.Session_handle.t -> P11.Data.t -> P11.Data.t
val multipart_encrypt_final : P11.Session_handle.t -> P11.Data.t
val multipart_decrypt_init : P11.Session_handle.t -> P11.Mechanism.t -> P11.Object_handle.t -> unit
val multipart_decrypt_chunck : P11.Session_handle.t -> P11.Data.t -> P11.Data.t
val multipart_decrypt_final : P11.Session_handle.t -> P11.Data.t
val multipart_sign_init : P11.Session_handle.t -> P11.Mechanism.t -> P11.Object_handle.t -> unit
val multipart_sign_chunck : P11.Session_handle.t -> P11.Data.t -> unit
val multipart_sign_final : P11.Session_handle.t -> P11.Data.t
val verify : P11.Session_handle.t -> P11.Mechanism.t -> P11.Object_handle.t -> data:P11.Data.t -> signature:P11.Data.t -> unit
val multipart_verify_init : P11.Session_handle.t -> P11.Mechanism.t -> P11.Object_handle.t -> unit
val multipart_verify_chunck : P11.Session_handle.t -> P11.Data.t -> unit
val multipart_verify_final : P11.Session_handle.t -> P11.Data.t -> unit
val multipart_verify : P11.Session_handle.t -> P11.Mechanism.t -> P11.Object_handle.t -> P11.Data.t list -> P11.Data.t -> unit