Expand description
Signed overlays (C-052, spec/threat-model.md §4).
Detached Ed25519 signatures over raw file bytes: <file>.sig
sidecars naming the signing key (kid) plus the hex signature.
Verification resolves kid against a trusted-keys set; enforcement
hooks into include loading via ParseOptions (E032). Key files
are bearer credentials (0600, never committed, never logged).
Structs§
- Sidecar
- Parsed sidecar: the claiming key id plus the raw signature.
Functions§
- generate_
secret_ key - Generate a fresh secret seed from OS randomness.
- load_
secret_ key - Parse a 64-hex-char Ed25519 secret seed (a
<name>.secretfile). - load_
trusted_ keys - Parse a trusted-keys TOML document (
[[keys]] id/public) into an id-keyed map. Malformed entries are hard errors naming the entry, never key material. - public_
hex - Hex of a verifying key (for the trusted-keys TOML).
- read_
sidecar - Read a sibling sidecar or report it missing (unsigned). Public so enforcement paths share the exact unsigned wording.
- secret_
hex - Hex of a signing key’s seed (for
<name>.secretfiles). - sidecar_
path_ for - Sidecar path for a file:
.sigappended to the full filename (foo.active↔foo.active.sig). Detached, so signatures survive formatters, and distinct from other tools’ habits. - sign_
bytes - Sign raw bytes: the sidecar body for
<file>.sig. The key id is validated first — raw interpolation into TOML would otherwise admit injection via quotes, escapes, or newlines. - valid_
kid - Key-id charset: printable, no TOML metacharacters, no controls, non-empty. Enforced when writing sidecars, when parsing them, and when loading trusted sets — an id that cannot round-trip byte-identical through TOML is rejected everywhere (injection and log-forging resistance).
- verify_
bytes - Verify file bytes against sidecar text and a trusted-keys map. Returns the signing key id on success; every failure names the file and the reason, never key material.
- verify_
file - Verify a file on disk plus its sibling sidecar: point-in-time
attestation for operators (TOCTOU between check and use is the
caller’s concern). Enforcement paths that go on to PARSE the
file must read once and call
verify_byteson the buffer instead — see the include hook.
Type Aliases§
- Trusted
Keys - A trusted key set: key id → public key. Cloned into the parser when overlay enforcement is on (small maps; no lifetimes).