Module jwt::algorithm[][src]

Expand description

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_from_slice(b"some-secret").unwrap();

Modules

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.

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

Enums

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

Traits

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

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