package pkcs11-driver

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

Install

Dune Dependency

Authors

Maintainers

Sources

pkcs11-v1.0.0.tbz
sha256=eee2e67fff116d747d1d0f6229af9e952cbb4f9a56765c069c63c1e1bbbc67a3
sha512=3a1090b0cd53b09dffb4c2a2d591e290ff3fe9add1217797f9746a1a6af0d41239b217f1dd45354e3ee457ff007d68bb4d8d83f07001d6ad9870e7aaba4fd434

doc/src/pkcs11-driver/pkcs11_CK_KEY_DERIVATION_STRING_DATA.ml.html

Source file pkcs11_CK_KEY_DERIVATION_STRING_DATA.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
25
open Ctypes
open Ctypes_helpers

type _t
type t = _t structure
let t: t typ = structure "CK_KEY_DERIVATION_STRING_DATA"

let (-:) typ label = smart_field t label typ
let pData = Reachable_ptr.typ Pkcs11_CK_BYTE.typ -: "pData"
let ulLen = ulong -: "ulLen"
let () = seal t

type u = string

let make (u: u): t =
  let t = make t in
  let data = ptr_from_string u in
  Reachable_ptr.setf t pData data;
  setf t ulLen (Unsigned.ULong.of_int @@ String.length u);
  t

let view (t: t): u =
  string_from_ptr
    ~length:(getf t ulLen |> Unsigned.ULong.to_int)
    (Reachable_ptr.getf t pData)
OCaml

Innovation. Community. Security.