Class Token<P>

Token represents a single token with methods to sign and verify. This token is derived from a strict subset of the JWS specification. The token payload must abide by the registered claims of JWS, additional properties that do not conflict are allowed. For public key signatures, it only supports EdDSA algorithm. For MAC signatures, it only supports BLAKE2b algorithm. Multiple signatures are allowed, including 0 signatures. During signing, additional properties can be part of the protected header. The encoded format is compatible with the General JWS JSON format.

Type Parameters

Hierarchy

  • Token

Constructors

Properties

_signatures: TokenHeaderSignature[] = []
_signaturesEncoded: TokenHeaderSignatureEncoded[] = []
payload: Readonly<P>
payloadEncoded: TokenPayloadEncoded
signatureSet: Set<TokenSignatureEncoded> = ...

Accessors

Methods

  • Parameters

    • key: Key
    • Optional additionalProtectedHeader: POJO
    • force: boolean = false

    Returns void

  • Parameters

    Returns void

  • Iterates over the signatures and attempts MAC verification

    Parameters

    Returns boolean

  • Iterates over the signatures and attempts digital signature verification

    Parameters

    Returns boolean

Generated using TypeDoc