ywt/algorithm

Types

A JWT signing algorithm.

The algorithm fixes both the signing primitive and digest. Prefer asymmetric algorithms when multiple services need to verify tokens; HMAC keys are shared secrets and any verifier can also forge tokens. If you do not have a compatibility constraint, es384 is a good default.

pub opaque type Algorithm

Values

pub const es256: Algorithm

ECDSA with the P-256 curve and SHA-256.

pub const es384: Algorithm

ECDSA with the P-384 curve and SHA-384.

pub const es512: Algorithm

ECDSA with the P-521 curve and SHA-512.

pub const hs256: Algorithm

HMAC with SHA-256.

pub const hs384: Algorithm

HMAC with SHA-384.

pub const hs512: Algorithm

HMAC with SHA-512.

pub const ps256: Algorithm

RSA PSS with SHA-256.

pub const ps384: Algorithm

RSA PSS with SHA-384.

pub const ps512: Algorithm

RSA PSS with SHA-512.

pub const rs256: Algorithm

RSA PKCS#1 v1.5 with SHA-256.

pub const rs384: Algorithm

RSA PKCS#1 v1.5 with SHA-384.

pub const rs512: Algorithm

RSA PKCS#1 v1.5 with SHA-512.

Search Document