layercert

package
v0.29.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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.

View Source
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

func DigestFromWord(word string) (string, bool)

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

func Digests(pems []string) ([]string, error)

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

func Normalize(items []string) ([]string, error)

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.

func Word

func Word(digest string) string

Word is what the guest extends PCR 15 with for the certificate whose DER has the given digest.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL