package pkcs11

  1. Overview
  2. Docs
PKCS#11 OCaml types

Install

dune-project
 Dependency

Authors

Maintainers

Sources

pkcs11-v1.0.1.tbz
sha256=db6bed28e4a75cb3787d0b6feca954a91c9e52e678b8cc73c1058975b1846946
sha512=f764b356cac3dd7718003a158f2a4dad7b8caae981930ab9cfa674a08ebcf3583c531bfcca9ddbb593d0c8e5a64b52381f8c9c702c3a0d0d44000727b095c47a

doc/src/pkcs11/p11_session_info.ml.html

Source file p11_session_info.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
let string_of_flags = P11_flags.(to_pretty_string Session_info_domain)

let session_info_flags_to_yojson flags =
  P11_flags.to_json ~pretty:string_of_flags flags

type session_info_flags = P11_flags.t [@@deriving eq, ord, show, of_yojson]

type t =
  { slotID : P11_ulong.t
  ; state : P11_ulong.t
  ; flags : session_info_flags
  ; ulDeviceError : P11_ulong.t }
[@@deriving eq, ord, show, yojson]

let to_strings info =
  [ ("Slot ID", Unsigned.ULong.to_string info.slotID)
  ; ("State", Unsigned.ULong.to_string info.state)
  ; ("Flags", string_of_flags info.flags)
  ; ("Device Error", Unsigned.ULong.to_string info.ulDeviceError) ]

let to_string ?newlines ?indent info =
  P11_helpers.string_of_record ?newlines ?indent (to_strings info)

let to_strings info = P11_helpers.strings_of_record @@ to_strings info