Expand description
passport-rs
A library for generating JWT passports following RFC-8225
Usage:
let passport_builder =
passport::PassportBuilder::new(String::from("https://cert.example.org/passport.cer"), passport::Identity::URI(String::from("https://matrix.to/#/@alice:example.org")))
.add_destination(passport::Identity::URI(String::from("https://matrix.to/#/@bob:example.org")))
.set_expires_in(Some(512));
let jwt = passport_builder.encode(
&passport::EncodingKey::from_secret(b"test_secret"),
passport::Algorithm::HS512,
).unwrap();
Modules§
- config
- Structs for representing and parsing JWT data from configuration files
Structs§
- Encoding
Key - A key to encode a JWT with. Can be a secret, a PEM-encoded key or a DER-encoded key. This key can be re-used so make sure you only initialize it once if you can for better performance.
- Media
Key - Represents the Media Key claim
- Passport
Builder - Factory for building passports
- Passport
Claims - Extended JWT Claims for passports
Enums§
- Algorithm
- The algorithms supported for signing/verifying JWTs
- Error
- Wrapper for both JWT and Serde errors
- Identity
- Represents and holds the different forms of identification
- Identity
Forms - Ways of repsenting identities
Functions§
- make_
decoding_ key - Given the key and an algorithm it will return a
DecodingKey
- make_
encoding_ key - Given the key and an algorithm it will return an
EncodingKey