StaticdecodeParses a token and validates its structure WITHOUT checking the
signature or any timestamps. Use verifySignature for the
signature; expiration is checked by Session.verifyAttested.
MALFORMED/FORMAT on any structural
problem: wrong shape, invalid Base64URL, size over
ATTESTATION_MAX_PAYLOAD, non-JSON payload, wrong typ,
missing/ill-typed fields, or a non-positive/NaN maxSessionTtl.
StaticverifyVerifies the token signature against a public key.
A signature whose length differs from the 64-byte Ed25519 size is
rejected with false before any crypto runs (PR-7 pre-check) —
the method therefore never throws for short/long signatures.
false for a bad signature or a wrong key. Returns
false for any invalid signature, including malformed lengths.
It still throws AttestationError MALFORMED/FORMAT for
structurally invalid tokens (see decode).
StaticmatchStaticissueCreates and signs a new attestation.
The subject name is canonicalized (NFKC → lowercase → trim) before
signing; the subject public key must be exactly 32 bytes. Serialization is
deterministic: fields are emitted in a fixed order and
undefined grant fields are omitted from the JSON entirely
(distinguishable from []).
The signer is a Signer — typically the issuing
Identity (root attestations) or Handle (SubHandle
attestations). Raw private keys never cross a trust boundary as
function arguments (D2): the key material stays encapsulated in the
signer object.
Object producing the Ed25519 signature via
sign(data). Identity and Handle implement Signer; custom
implementations (remote/HSM-backed signing) are accepted
structurally.
32-byte Ed25519 public key being attested.
Child name; canonicalized before signing.
Constraints enforced by verifiers (Mode 2).
Optionalopts: { Lifetime control: ttlSeconds (default one year),
expiresAt (overrides ttlSeconds), jti (default random UUID),
now (fixed clock for deterministic tests).
OptionalttlOptionalexpiresOptionaljti?: stringOptionalnow?: numberThe attestation with payload, token and jti accessors.
A parent-signed statement binding a derived child key to a name and a grant. Chains of attestations (
Identity → Handle → SubHandle) allow any third party to verify sessions offline using only the root public key, with grant constraints enforced at verification time.Tokens have the form
base64url(payload).base64url(signature)and are deterministic: the same inputs (includingjtiandnow) always produce byte-identical tokens.Example