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.
- OutOf
Range - A value falls outside the
NumericDateinvariant range (before the unix epoch, or after the last second of year 9999). Returned by fallible, non-clamping operations such as theTryFrom<SystemTime>conversion. - RS256Sk
- RS256 private key
- RS256Vk
- RS256 public key
Enums§
Constants§
- MAX_
TIMESTAMP_ 🔒SECS - Invariant upper bound of
NumericDate(see its docs):9999-12-31T23:59:59Z.
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.