1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//! JSON Web Token (JWT) parsing and verification.
//!
//! Implements JWT validation per RFC 7519. HMAC-based signing/verification
//! (HS256, HS512) is always available; asymmetric signing/verification
//! (`EdDSA` per RFC 8037, ES256 per RFC 7518) plus JWKS (RFC 7517) and key
//! rotation are added behind the `asym-jwt` feature (enabled transitively by
//! `oidc`).
//!
//! This module both **mints** tokens ([`JwtEncoder`]) and **verifies**
//! them ([`verify_jwt`]); the two are symmetrical, so a token produced by
//! [`JwtEncoder::sign`] round-trips through [`verify_jwt`]. The asymmetric
//! counterparts are [`JwtEncoder::sign_asymmetric`] and
//! [`verify_jwt_asymmetric`] / [`KeyRing::verify`] / [`JwkSet::verify`].
//!
//! # Security
//!
//! - The `"none"` algorithm is **always rejected** on verification, and is
//! **unrepresentable** for signing: [`JwtEncoder::sign`] is parameterised
//! by [`JwtSigningAlgorithm`], which has no `None` variant, so this crate
//! cannot produce an unsigned token.
//! - Signature verification uses constant-time comparison via
//! [`crate::crypto::constant_time::constant_time_eq`].
//! - Clock skew tolerance is configurable but must be explicitly opted
//! into by the caller.
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use verify_jwt_asymmetric;