Documentation
¶
Overview ¶
Package layercert handles an installation's layer certificates: the X.509 certificates a caller hands create_vm as layer_certificates. The IMDS serves them to the guest as /layer-certificates; the initrd enrolls them into the kernel's .dm-verity keyring next to the image's own layer certificate and, before it seals the keyring, extends PCR 15 once per certificate in the order served with Word. The attestation verifier replays those measurements from the ready quote and requires exactly the certificates served (internal/attest).
Index ¶
Constants ¶
const ( // MaxCertificates bounds the list; a rotation overlaps old and new // certificates, so a few per installation is the expected size. MaxCertificates = 16 // MaxCertificateBytes bounds the DER of one certificate. MaxCertificateBytes = 16 << 10 )
Limits on the certificates of one VM.
const WordPrefix = "layer-certificate:"
WordPrefix starts the word the guest extends PCR 15 with for each certificate: `systemd-pcrextend --pcr=15 layer-certificate:<digest>`.
Variables ¶
This section is empty.
Functions ¶
func DigestFromWord ¶
DigestFromWord returns the digest a measured word names and whether the word is a layer certificate word with a well-formed digest (64 lowercase hex characters).
func Digests ¶
Digests returns the lowercase hex sha256 of each certificate's DER, in order: what the guest measures (Word) and the verifier compares. The input is Normalize's output; anything else is an error.
func Normalize ¶
Normalize validates the certificates a caller passed and returns them in canonical PEM, one certificate per element, in the caller's order. An element may hold several CERTIFICATE blocks and whitespace between them; anything else (another block type such as a private key, text outside the blocks, PEM headers, a block that is not an X.509 certificate, a certificate given twice) is an error that names the element and block but never echoes their content. Nil or empty input returns nil.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package layercerttest makes self-signed layer certificates for tests.
|
Package layercerttest makes self-signed layer certificates for tests. |