ReadonlyhandleReadonlyhandleReadonlyaudienceReadonlyscopesReadonlyexpiresReadonlytokenOptional ReadonlypathDerivation path, present only for SubHandle sessions.
ReadonlysessionUnique session identifier, used for revocation.
StaticcreateCreates a new signed session token.
If the handle is a SubHandle, its constraints are validated
before signing (audience, scopes, TTL, expiration). The derivation
path is included in the payload as hPath.
The Handle or SubHandle that will sign this session.
Session configuration including audience, scopes, TTL, and optional sessionId.
A Promise resolving to a new Session instance.
StaticverifyVerifies a session token statelessly without server-side storage.
Validates:
hId, hNm, aud, scp, exp, iat, jti)For SubHandle sessions (those with hPath), the Handle/SubHandle is
reconstructed atomically via Identity.deriveSubHandle.
The Base64URL-encoded session token string.
The Identity used to reconstruct Handle/SubHandle public keys.
The audience that this token must be intended for.
OptionalrevocationChecker: RevocationCheckerOptional checker for revocation list.
A Promise resolving to a verified Session instance.
StaticverifyVerifies a session token together with its attestation chain (Mode 2 - using an attestation chain) — for verifiers that hold only the root PUBLIC key.
The chain contains serialized attestations, root first:
[attestHandle_token] (length 1)[attestHandle_token, attestSubHandle_token]
(length 2)Enforced, in order: token structure and required fields (including
iat); audience; session time (±30 s skew); chain shape; parent
signature against rootPublicKey; parent validity and revocation;
for subhandle sessions — child signature against the parent's
subjectId, child validity/revocation, name/path agreement,
wildcard permitting, hId == child.subjectId, and grant nesting
(child scopes ⊆ parent scopes, child maxTtl ≤ parent maxTtl);
session vs the effective grant (scopes, audiences, TTL); session
expiry against the earliest attestation expiry; session signature
against hId; session revocation — last.
Attestation tokens, root first; length must match the session kind (1 for Handle, 2 for SubHandle).
OptionalrevocationChecker: RevocationCheckerOptional; consulted for attestation
jti values (each chain level) and the session jti.
The verified session.
With code and level identifying the
failed layer — integrate on these fields, not on message text.
const A = await identity.attestHandle('station-001', grantA);
const sub = await station.deriveSubHandle('connector-ccs');
const B = await station.attestSubHandle('connector-ccs', grantB);
const session = await Session.create(sub, {
audience: 'ev-app.com', scopes: ['charge:start'], ttl: 1800,
});
const verified = await Session.verifyAttested(
session.token, identity.getPublicKey(), [A.token, B.token],
'ev-app.com',
);
Represents a stateless, cryptographically verifiable session token.
Instead of storing session state on the server, the Session object encapsulates all necessary authorization data (handle ID, scopes, expiration, derivation path) into a self-contained structure that can be verified using the Handle's or SubHandle's public key.
Sessions can be created from either a Handle or a SubHandle. When created from a SubHandle, the token carries the derivation path (
hPath) for hierarchical auditing.