package conex
Module type Conex_private.SSource
The private key module type
The type of a private key
ids () is the list of all available private keys.
Source
val read :
(float -> Conex_resource.timestamp option) ->
Conex_resource.identifier ->
(t, r_err) resultread id is either Ok priv, the private key corresponding to id, or an Error.
created t is the timestamp when t was created.
id t is the identifier of t.
Source
val generate :
?bits:int ->
(float -> Conex_resource.timestamp option) ->
Conex_resource.Key.alg ->
Conex_resource.identifier ->
unit ->
(t, string) resultgenerate ~bits alg id () generates a fresh private key using alg for id, or an error. Generate also ensures to persistently store the generated key if desired.
pub_of_priv priv extracts the public key out of priv.
Source
val sign :
Conex_resource.Wire.t ->
Conex_resource.timestamp ->
Conex_resource.identifier ->
Conex_resource.Signature.alg ->
t ->
(Conex_resource.Signature.t, string) resultsign wire now id alg priv signs wire with priv using alg, and evaluates to a signature, or an error.