Skip to main content

Module jwt

Module jwt 

Source
Expand description

JWT helpers: HS256 (shared-secret) and ES256/RS256 (PEM-key, asymmetric) — the asymmetric pair is what any estate OIDC issuer needs (research loop wave 3b prerequisite).

Enums§

JwtError
Errors for JWT operations.

Functions§

build_auth_cookie
Build a Set-Cookie header value for an auth token.
decode_es256
Decode and validate an ES256 JWT, returning typed claims.
decode_hs256
Decode and validate an HS256 JWT, returning typed claims.
decode_rs256
Decode and validate an RS256 JWT, returning typed claims.
encode_es256
Encode a claims struct as an ES256 JWT (P-256 ECDSA, PKCS#8 PEM key).
encode_hs256
Encode a claims struct as an HS256 JWT.
encode_rs256
Encode a claims struct as an RS256 JWT (RSA, PKCS#8 PEM key).
extract_bearer_token
Extract a Bearer token from an Authorization header value.