package pkcs11

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

Source file p11_pkcs5_pbkd2_pseudo_random_function_type.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
type t =
  | CKP_PKCS5_PBKD2_HMAC_SHA1
[@@deriving eq,ord]

let to_string = function
  | CKP_PKCS5_PBKD2_HMAC_SHA1 -> "CKP_PKCS5_PBKD2_HMAC_SHA1"

let of_string = function
  | "CKP_PKCS5_PBKD2_HMAC_SHA1" -> CKP_PKCS5_PBKD2_HMAC_SHA1
  | _ -> invalid_arg "CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE.of_string"

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

let of_yojson = P11_helpers.of_json_string ~typename:"random function type" of_string