Skip to main content

Module jwt

Module jwt 

Source
Expand description

JWT token implementation.

Re-exports EdDSA signing from hyprstream-rpc and adds ES256 (P-256) signing.

Structs§

Claims
JWT claims for authentication.

Enums§

JwtError
Errors from JWT operations

Functions§

composite_jwk
Build a JWK for a composite ML-DSA-65-Ed25519 key (kty: "AKP").
composite_kid
Compute the RFC 7638 JWK thumbprint for one exact composite key pair.
decode
Decode and verify a JWT token issued by the local node.
decode_with_any_key
Try every supplied Ed25519 key for a JWT that has no kid.
decode_with_any_key_lenient
Lenient-audience twin of decode_with_any_key. This remains restricted to kid-less JWTs; only the absent-audience behavior differs.
decode_with_federation_candidates
Verify a federation JWT without losing its JWKS kid binding.
decode_with_key
Decode a JWT using a caller-supplied verifying key (for multi-issuer support).
encode
Encode a user/client OAuth 2.0 access token (typ: "at+jwt", RFC 9068). Includes kid in the JOSE header for key rotation support. Automatically assigns a jti if the claims don’t already have one.
encode_composite_ml_dsa_65_ed25519
Encode and sign a composite ML-DSA-65-Ed25519 JWT.
encode_composite_service_jwt
Encode a service WIT (typ: "wit+jwt") with ML-DSA-65-Ed25519 composite signature.
encode_es256
Encode and sign an OAuth 2.0 access token with ES256 (P-256 ECDSA).
encode_ml_dsa_65
Encode and sign a JWT with ML-DSA-65 (alg: "ML-DSA-65", kty: "AKP").
encode_service_jwt
Encode a WIMSE Workload Identity Token (typ: "wit+jwt") for service JWTs. Includes kid in the JOSE header for key rotation support. Automatically assigns a jti if the claims don’t already have one.
encode_service_jwt_hybrid_via_authority
Encode a service WIT with the mandatory hybrid suite for the dispatch plane.
es256_jwk
Build a JWK (serde_json::Value) for JWKS publishing from a P-256 signing key.
es256_kid
Compute the RFC 7638 JWK Thumbprint for a P-256 signing key.
generate_es256_key
Generate a new random P-256 signing key.
ml_dsa_65_jwk
Build a JWK for an ML-DSA-65 key (kty: "AKP").