Skip to main content

Module jwt

Module jwt 

Source
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 calling Claims::check and co.

Structs§

Claims
Represents a set of claims made by a JWT.
HS256
Key for SHA256 based HMAC
Header 🔒
Represents a JWT header.
HeaderType 🔒
Used to check that the typ field of the jwt header equals JWT (modulo case).
IgnoreSignature
A VerifyingKey that neglects to check the signature and alg header.
JWT
Wrapper around String to indicate it should be interpretted as a JWT.
NumericDate
Represents the value of the iat, exp, nbf claims.
NumericDateVisitor 🔒
Visitor for the implementation of Deserialize for NumericDate.
RS256Sk
RS256 private key
RS256Vk
RS256 public key

Enums§

Error

Traits§

Key
What SigningKey and VerifyingKey have in common.
SigningKey
Represents a key that can be used to sign a JWT.
VerifyingKey
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 claims using key yielding a JWT.