package pkcs11

  1. Overview
  2. Docs
PKCS#11 OCaml types

Install

Dune Dependency

Authors

Maintainers

Sources

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

doc/src/pkcs11/p11_key_gen_mechanism.ml.html

Source file p11_key_gen_mechanism.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
type t =
  | CKM of P11_mechanism_type.t
  | CK_UNAVAILABLE_INFORMATION
[@@deriving eq, ord, show]

let to_string = function
  | CKM x -> P11_mechanism_type.to_string x
  | CK_UNAVAILABLE_INFORMATION -> "CK_UNAVAILABLE_INFORMATION"

let of_string = function
  | "CK_UNAVAILABLE_INFORMATION" -> CK_UNAVAILABLE_INFORMATION
  | s -> CKM (P11_mechanism_type.of_string s)

let to_yojson mechanism_type =
  try `String (to_string mechanism_type) with
  | Invalid_argument _ -> `Null

let of_yojson =
  P11_helpers.of_json_string ~typename:"keygen mechanism" of_string
OCaml

Innovation. Community. Security.