package tls

  1. Overview
  2. Docs
include module type of struct include X509.Private_key end
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 sign : Mirage_crypto.Hash.hash -> ?scheme:X509.Key_type.signature_scheme -> t -> [ `Digest of Cstruct.t | `Message of Cstruct.t ] -> (Cstruct.t, [> `Msg of string ]) Stdlib.result
val decode_der : Cstruct.t -> (t, [> `Msg of string ]) Stdlib.result
val encode_der : t -> Cstruct.t
val decode_pem : Cstruct.t -> (t, [> `Msg of string ]) Stdlib.result
val encode_pem : t -> Cstruct.t
val sexp_of_t : 'a -> Sexplib.Sexp.t
OCaml

Innovation. Community. Security.