crypto.self_signed_cert

crypto

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:

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.