Skip to main content

Module cert

Module cert 

Source
Expand description

The viewer listener’s certificate: self-signed ECDSA P-256, made once and kept in this instance’s data directory, so its fingerprint (the one a paired device pinned from the QR) survives restarts. No CA is involved and nothing about the certificate itself is trusted; only the fingerprint is.

Structs§

ViewerTls
The certificate in use, its key and its fingerprint.

Constants§

CERT_FILE 🔒
DIR_NAME 🔒
Where the certificate and its key live under the data directory.
KEY_FILE 🔒

Functions§

cert_dir
The certificate directory under data_dir.
fingerprint
Lowercase hex SHA-256 of a certificate’s DER bytes.
generate 🔒
load 🔒
load_or_create
Load the certificate kept under data_dir, or make and keep a new one when there is none or what is there can’t be used.
store 🔒
Write both files through a temporary name, the key readable by this user only where the platform has modes.
write_atomic 🔒