package pkcs11

  1. Overview
  2. Docs
Bindings to the PKCS#11 cryptographic API

Install

dune-project
 Dependency

Authors

Maintainers

Sources

pkcs11-0.16.0.tbz
sha256=ff7078b01af18bb7107400304b092b7aec899aaa7adaf36d36ed9ac06e2bfa97
md5=2cbd89bd4a81aa97a02918f18c09fee7

doc/src/pkcs11/p11_ulong.ml.html

Source file p11_ulong.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
type t = Unsigned.ULong.t
[@@deriving ord]

let equal a b =
  compare a b = 0

let show = Unsigned.ULong.to_string

let pp fmt n =
  Format.pp_print_string fmt (show n)

let of_yojson = function
  | `String s -> Ok (Unsigned.ULong.of_string s)
  | _ -> Error "ulong_of_yojson: not a string"

let to_yojson ulong =
  `String (Unsigned.ULong.to_string ulong)

let (!) x  = Unsigned.ULong.of_string (Int64.to_string x)
let _CK_UNAVAILABLE_INFORMATION = ! (Int64.lognot 0x0L)
let _CK_EFFECTIVELY_INFINITE = Unsigned.ULong.zero

let is_unavailable_information t = (compare t _CK_UNAVAILABLE_INFORMATION) = 0
let is_effectively_infinite t = (compare t _CK_EFFECTIVELY_INFINITE) = 0