[][src]Module jwt::algorithm

Algorithms capable of signing and verifying tokens. By default only the hmac crate's Hmac type is supported. For more algorithms, enable the feature openssl and see the openssl module. The none algorithm is explicitly not supported.

Examples

use hmac::{Hmac, NewMac};
use sha2::Sha256;

let hs256_key: Hmac<Sha256> = Hmac::new_varkey(b"some-secret").unwrap();

Modules

openssl

OpenSSL support through the openssl crate. Note that private keys can only be used for signing and that public keys can only be used for verification.

rust_crypto

RustCrypto implementations of signing and verifying algorithms. According to that organization, only hmac is safely implemented at the moment.

store

Enums

AlgorithmType

The type of an algorithm, corresponding to the JWA specification.

Traits

SigningAlgorithm

An algorithm capable of signing base64 encoded header and claims strings. strings.

VerifyingAlgorithm

An algorithm capable of verifying base64 encoded header and claims strings.