| Crates.io | jwks |
| lib.rs | jwks |
| version | 0.5.2 |
| created_at | 2024-01-26 05:07:46.751846+00 |
| updated_at | 2026-01-13 18:25:40.2984+00 |
| description | A library for retrieving and parsing JSON Web Key Sets (JWKS) |
| homepage | |
| repository | https://github.com/chenhunghan/jwks |
| max_upload_size | |
| id | 1115214 |
| size | 132,666 |
Fetch and parse JSON Web Key Set (JWKS)
cargo add jwks
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();
For a complete example of using this library with jsonwebtoken to validate JWTs, see the examples/jwt_validation.rs file.
You can run the examples with:
# Basic usage example
cargo run --example basic_usage
# JWT validation example
cargo run --example jwt_validation