package pkcs11-driver

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

Install

dune-project
 Dependency

Authors

Maintainers

Sources

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

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
26
27
28
29
30
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)