Expand description
Implements limited JSON Web Token functionality for our purposes.
Created to reduce dependencies, and more immediately fix for this bug in rust’s ring crate was not yet stable at the time of writing: https://github.com/briansmith/ring/issues/1299
Modules§
- expecting
- Some common
FnOnce(Some(T))->Result<(),jwt::Error>s for callingClaims::checkand co.
Structs§
- Claims
- Represents a set of claims made by a JWT.
- HS256
- Key for SHA256 based HMAC
- Header 🔒
- Represents a JWT header.
- Header
Type 🔒 - Used to check that the
typfield of the jwt header equalsJWT(modulo case). - Ignore
Signature - A VerifyingKey that neglects to check the signature and
algheader. - JWT
- Wrapper around
Stringto indicate it should be interpretted as a JWT. - Numeric
Date - Represents the value of the
iat,exp,nbfclaims. - Numeric
Date 🔒Visitor - Visitor for the implementation of Deserialize for NumericDate.
- RS256Sk
- RS256 private key
- RS256Vk
- RS256 public key
Enums§
Traits§
- Key
- What SigningKey and VerifyingKey have in common.
- Signing
Key - Represents a key that can be used to sign a JWT.
- Verifying
Key - Represents a key that can be used to verify the signature on a JWT.
Functions§
- get_
current_ timestamp - Gets the number of seconds since the Unix epoch, which is an appropriate value for the “iat” field.
- sign
- Signs
claimsusingkeyyielding a JWT.