Module X509_async.Private_key

type t = [
  1. | `ED25519 of Mirage_crypto_ec.Ed25519.priv
  2. | `P256 of Mirage_crypto_ec.P256.Dsa.priv
  3. | `P384 of Mirage_crypto_ec.P384.Dsa.priv
  4. | `P521 of Mirage_crypto_ec.P521.Dsa.priv
  5. | `RSA of Mirage_crypto_pk.Rsa.priv
]
val generate : ?seed:string -> ?bits:int -> X509.Key_type.t -> t
val of_octets : string -> 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 -> string
val encode_pem : t -> string
val sign : Digestif.hash' -> ?scheme:Key_type.signature_scheme -> t -> [ `Digest of string | `Message of string ] -> 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
val of_pem_file : Core.Filename.t -> t Async.Deferred.Or_error.t