Library
Module
Module type
Parameter
Class
Class type
Public keys
type t = [
| `RSA of Mirage_crypto_pk.Rsa.pub
| `ED25519 of Mirage_crypto_ec.Ed25519.pub
| `P224 of Mirage_crypto_ec.P224.Dsa.pub
| `P256 of Mirage_crypto_ec.P256.Dsa.pub
| `P384 of Mirage_crypto_ec.P384.Dsa.pub
| `P521 of Mirage_crypto_ec.P521.Dsa.pub
]
The polymorphic variant of public keys, with PKCS 8 encoding and decoding to PEM.
id public_key
is digest
, the 160-bit `SHA1
hash of the BIT STRING subjectPublicKey (excluding tag, length, and number of unused bits) for publicKeyInfo of public_key
.
val fingerprint : ?hash:Mirage_crypto.Hash.hash -> t -> Cstruct.t
fingerprint ?hash public_key
is digest
, the hash (by default SHA256) of the DER encoded public key (equivalent to openssl x509 -noout -pubkey | openssl pkey -pubin -outform DER | openssl dgst -HASH
).
val key_type : t -> X509.Key_type.t
key_type public_key
is its key_type
.
val verify :
Mirage_crypto.Hash.hash ->
?scheme:Key_type.signature_scheme ->
signature:string ->
t ->
[ `Digest of string | `Message of string ] ->
unit Core.Or_error.t
val decode_der : contents:string -> t Core.Or_error.t
val decode_pem : contents:string -> t Core.Or_error.t