#jwk #jwk-set #json-web-key #jwt

jwks

A library for retrieving and parsing JSON Web Key Sets (JWKS)

7 releases (4 breaking)

0.5.3 Feb 23, 2026
0.5.2 Jan 13, 2026
0.4.0 Feb 27, 2025
0.3.0 Feb 14, 2025
0.1.2 Jan 26, 2024

#412 in Authentication

Download history 1522/week @ 2026-04-17 1145/week @ 2026-04-24 860/week @ 2026-05-01 1441/week @ 2026-05-08 1536/week @ 2026-05-15 1533/week @ 2026-05-22 1009/week @ 2026-05-29 1424/week @ 2026-06-05 1844/week @ 2026-06-12 1948/week @ 2026-06-19 1236/week @ 2026-06-26 2104/week @ 2026-07-03 2392/week @ 2026-07-10 2151/week @ 2026-07-17 1810/week @ 2026-07-24 1214/week @ 2026-07-31

8,349 downloads per month

Custom license

39KB
790 lines

jwks

Fetch and parse JSON Web Key Set (JWKS)

cargo add jwks

https://crates.io/crates/jwks

Usage

Basic Usage

From a jwks url:

let jwks_url = "https://www.googleapis.com/oauth2/v3/certs";
let jwks = Jwks::from_jwks_url(jwks_url).await.unwrap();

From a openid config url:

let openid_config_url = "https://accounts.google.com/.well-known/openid-configuration";
let jwks = Jwks::from_oidc_url(openid_config_url).await.unwrap();

JWT Validation

For a complete example of using this library with jsonwebtoken to validate JWTs, see the examples/jwt_validation.rs file.

Running Examples

You can run the examples with:

# Basic usage example
cargo run --example basic_usage

# JWT validation example
cargo run --example jwt_validation

Dependencies

~20–48MB
~851K SLoC