package tls-async

  1. Overview
  2. Docs
type t = [
  1. | `ED25519 of Mirage_crypto_ec.Ed25519.priv
  2. | `P224 of Mirage_crypto_ec.P224.Dsa.priv
  3. | `P256 of Mirage_crypto_ec.P256.Dsa.priv
  4. | `P384 of Mirage_crypto_ec.P384.Dsa.priv
  5. | `P521 of Mirage_crypto_ec.P521.Dsa.priv
  6. | `RSA of Mirage_crypto_pk.Rsa.priv
]
val generate : ?seed:Cstruct.t -> ?bits:int -> X509.Key_type.t -> t
val of_cstruct : Cstruct.t -> X509.Key_type.t -> (t, [> `Msg of string ]) Stdlib.result
val of_string : ?seed_or_data:[ `Data | `Seed ] -> ?bits:int -> X509.Key_type.t -> string -> (t, [> `Msg of string ]) Stdlib.result
val key_type : t -> X509.Key_type.t
val public : t -> X509.Public_key.t
val encode_der : t -> Cstruct.t
val encode_pem : t -> Cstruct.t
val sign : Mirage_crypto.Hash.hash -> ?scheme:Key_type.signature_scheme -> t -> [ `Digest of Cstruct.t | `Message of Cstruct.t ] -> string Core.Or_error.t
val decode_der : contents:string -> t Core.Or_error.t
val decode_pem : contents:string -> t Core.Or_error.t
OCaml

Innovation. Community. Security.