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

Structs for representing and parsing JWT data from configuration files

Structs

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

Represents the Media Key claim

Factory for building passports

Extended JWT Claims for passports

Enums

The algorithms supported for signing/verifying JWTs

Wrapper for both JWT and Serde errors

Represents and holds the different forms of identification

Ways of repsenting identities

Functions

Given the key and an algorithm it will return a DecodingKey

Given the key and an algorithm it will return an EncodingKey