self_signed_cert(
seed,opts) ->cert,err
Generate a self-signed X.509 certificate over an Ed25519 key
seed is the 32-byte private key ed25519_generate_key returns. The
key signs its own certificate, so no CA is asked. opts holds:
common_name: the subject's and the issuer's CN, 1 to 64 bytes of
UTF-8 with no control characters. Required.sans: an array of DNS names for the SubjectAltName extension, 32 at
most. Without it the certificate carries no extension.not_before, not_after: the validity span, Unix timestamps.
not_before defaults to now, not_after to 3650 days past
not_before.serial: the serial number, 1 to 20 raw bytes, big-endian, top bit
clear, not zero. Defaults to 16 random bytes.Returns a table with der, the certificate, and pem, the same bytes
under CERTIFICATE armor. parse_x509_cert reads either, and gives the
key_hash a client pins.
A client that verifies hostnames matches sans when it is present and
common_name only when it is not. Ed25519 signs without a nonce: one
seed, one opts with a serial and both dates give the same bytes on
every call.