package conex-mirage-crypto

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Conex_mirage_crypto.CSource

Sourcetype t

The abstract type t for keys

Sourceval decode_priv : string -> Conex_resource.timestamp -> string -> (t, string) result

decode_priv id ts data decodes the private key from data and returns a t or an error.

Sourceval bits : t -> int

bits t is the number of bits in t.

created t is the timestamp of creation of t.

id t is the identifier of t.

alg t is the algorithm of t.

Sourceval generate : alg:Conex_resource.Key.alg -> ?bits:int -> unit -> string * string

generate ~alg ~bits () generates a private key.

Sourceval pub_of_priv : t -> string

pub_of_priv priv is for RSA keys the PEM-encoded PKCS8 public key of priv, for Ed25519 keys the raw public key.

Sourceval sign : t -> string -> (string, string) result

sign priv data is for RSA keys the raw PSS signature of data using priv or an error, for Ed25519 keys the signature.

Sourceval sha256 : string -> string

sha256 s is the SHA256 digest of s.