A simple library for generating and verifying JWTs using aws-lc-rs
This library does not implement the JWS specifications from the RFCs.
HS256
HS384
HS512
RS256
RS384
RS512
PS256
PS384
PS512
ES256
ES384
ES512
ES256K
(ECDSA P-256K1/secp256k1)EdDSA
(Ed25519)
Header:
typ
(Type), always check it is set to"JWT"
(case-sensitive)alg
(Algorithm), verify that the requested algorithm is what you expect.
Claims/body:
iss
(Issuer)sub
(Subject)aud
(Audience)exp
(Expiry)nbf
(Not before)- Any other custom validation can be implemented using the
Validator
trait
Note: While we don't provide validation for jti
and iat
, you can implement it using the Validator
trait.
See the tests for examples.
This project is dual-licensed under the Apache-2.0 and MIT licenses at your convenience.
The current minimum supported Rust version is 1.81.0
This will be bumped periodically as we support newer versions of Rust.
jsonwebtoken
by Keats- Main inspiration and reference
- Took some code related to
ClaimsForValidation
and some of thepem
handling.