object
jwt_compact
JWT compact serialization parsing and generation helpers.
Availability:
logtalk_load(jwt(loader))Author: Paulo Moura
Version: 1:0:0
Date: 2026-07-06
Compilation flags:
static, context_switching_callsRemarks:
(none)
Inherited public predicates:
Public predicates
decode/3
Decodes a compact JWT into header and claims JSON terms without verifying the signature.
Compilation flags:
staticTemplate:
decode(Token,Header,Claims)Mode and number of proofs:
decode(+atom,-term,-term) - one_or_errorExceptions:
Token is a variable:instantiation_errorToken is neither a variable nor an atom:type_error(atom,Token)Token is an atom but not a valid compact JWT:domain_error(jwt_compact_serialization,Token)Token contains Base64URL data with characters outside the Base64URL alphabet:representation_error(base64)decode/5
Decodes a compact JWT into header, claims, signature bytes, and signing input.
Compilation flags:
staticTemplate:
decode(Token,Header,Claims,Signature,SigningInput)Mode and number of proofs:
decode(+atom,-term,-term,-list(byte),-atom) - one_or_errorExceptions:
Token is a variable:instantiation_errorToken is neither a variable nor an atom:type_error(atom,Token)Token is an atom but not a valid compact JWT:domain_error(jwt_compact_serialization,Token)Token contains Base64URL data with characters outside the Base64URL alphabet:representation_error(base64)header/2
Decodes only the JWT header JSON term.
Compilation flags:
staticTemplate:
header(Token,Header)Mode and number of proofs:
header(+atom,-term) - one_or_errorExceptions:
Token is a variable:instantiation_errorToken is neither a variable nor an atom:type_error(atom,Token)Token is an atom but not a valid compact JWT:domain_error(jwt_compact_serialization,Token)Token contains Base64URL data with characters outside the Base64URL alphabet:representation_error(base64)claims/2
Decodes only the JWT claims JSON term.
Compilation flags:
staticTemplate:
claims(Token,Claims)Mode and number of proofs:
claims(+atom,-term) - one_or_errorExceptions:
Token is a variable:instantiation_errorToken is neither a variable nor an atom:type_error(atom,Token)Token is an atom but not a valid compact JWT:domain_error(jwt_compact_serialization,Token)Token contains Base64URL data with characters outside the Base64URL alphabet:representation_error(base64)segments/5
Splits a compact JWT into Base64URL segments and signing input.
Compilation flags:
staticTemplate:
segments(Token,HeaderSegment,PayloadSegment,SignatureSegment,SigningInput)Mode and number of proofs:
segments(+atom,-atom,-atom,-atom,-atom) - one_or_errorExceptions:
Token is a variable:instantiation_errorToken is neither a variable nor an atom:type_error(atom,Token)Token is an atom but not a valid compact JWT:domain_error(jwt_compact_serialization,Token)signing_input/4
Encodes header and payload JSON terms and returns the compact signing input.
Compilation flags:
staticTemplate:
signing_input(Header,Payload,HeaderSegment,SigningInput)Mode and number of proofs:
signing_input(+term,+term,-atom,-atom) - one_or_errorExceptions:
Header or Payload cannot be encoded as JSON:domain_error(json_sink,HeaderOrPayload)Header or Payload cannot be encoded as Base64URL bytes:domain_error(base64url_sink,codes(Codes))compact/4
Builds a compact JWT from a signing input and signature bytes.
Compilation flags:
staticTemplate:
compact(HeaderSegment,SigningInput,Signature,Token)Mode and number of proofs:
compact(+atom,+atom,+list(byte),-atom) - one_or_errorExceptions:
Signature cannot be encoded as Base64URL bytes:domain_error(base64url_sink,codes(Codes))Protected predicates
(no local declarations; see entity ancestors if any)
Private predicates
(no local declarations; see entity ancestors if any)
Operators
(none)