Skip to main content

Module presentation

Module presentation 

Source
Expand description

Presentation verification primitives (the challenge-response canonical and its check). Same reason: one code path across CLI, WASM, and SDKs. Presentation verification primitives: the challenge-response canonical and its check, shared by the CLI (present / verify-presentation), the WASM verifier, and the SDKs so all agree by construction.

Lifted verbatim from packages/cli/src/commands/present.rs. Pure, no I/O. challenge_canonical is byte-critical: a single-byte change to its domain separation would silently break every previously signed challenge.

Structs§

PresentationVerdict
The full trust verdict for a presentation: card authenticity, revocation, challenge liveness, and staple anchoring. Freshness policy (--max-staple-age) and rendering stay with the caller.
StapleVerdict
The outcome of verifying a presentation’s staple (a checkpoint plus this card’s Merkle inclusion proof).

Enums§

ChallengeOutcome
The outcome of the challenge-response handshake within a presentation.
StapleStatus
Why a presentation’s staple did or didn’t verify. Core stays free of CLI-specific text; the caller formats a human message from this.

Functions§

challenge_canonical
The canonical bytes a challenge response signs (the handshake).
check_challenge
Verify a presentation’s challenge block against the nonce THIS verifier issued and the subject key the card verification established. Returns the bearer-signed signed_at on success; a specific, honest reason on failure. Pure — unit-tested against real keys.
verify_presentation
Verify a presentation against the caller’s pinned trust roots at now_unix. Composes the resolution chain walk, staple verification, and the challenge check into one decision — the same code path the CLI, WASM, and SDKs run. expected_nonce is the nonce THIS verifier issued (None when not challenging). Pure — no I/O, no system clock. The caller has already parsed the presentation JSON and validated its envelope type.
verify_staple
Verify a presentation’s staple against pinned trust roots at now_unix. Pure and time-injected: the caller supplies the current time (used only to report the checkpoint’s age; verification itself does not depend on it).