Establishing trust in community repositories
Module type Conex_private . S
type t

The type of a private key

val ids : unit -> Conex_resource.identifier list

ids () is the list of all available private keys.

type r_err = [
| `Decode of string
| `Read of string
| `None
| `Multiple of string list
val pp_r_err : r_err Conex_utils.fmt
val read : ( float -> Conex_resource.timestamp option ) -> Conex_resource.identifier -> ( t, r_err ) result

read id is either Ok priv, the private key corresponding to id, or an Error.

val bits : t -> int

bits t is the number of bits of the private key t.

val created : t -> Conex_resource.timestamp

created t is the timestamp when t was created.

id t is the identifier of t.

val generate : ?bits:int -> ( float -> Conex_resource.timestamp option ) -> Conex_resource.Key.alg -> Conex_resource.identifier -> unit -> ( t, string ) result

generate ~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.

val pub_of_priv : t -> Conex_resource.Key.t

pub_of_priv priv extracts the public key out of priv.

sign wire now id alg priv signs wire with priv using alg, and evaluates to a signature, or an error.