Skip to main content

Key

Trait Key 

Source
pub trait Key {
    const ALG: &'static str;

    // Provided method
    fn check_alg(alg: &str) -> Result<(), Error> { ... }
}
Expand description

What SigningKey and VerifyingKey have in common.

Required Associated Constants§

Source

const ALG: &'static str

value for alg in the JWT header

Provided Methods§

Source

fn check_alg(alg: &str) -> Result<(), Error>

Checks that alg equals Self::ALG.

This method is overriden by IgnoreSignature.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Key for SigningKey

Source§

const ALG: &'static str = "EdDSA"

Source§

impl Key for VerifyingKey

Source§

const ALG: &'static str = "EdDSA"

Implementors§

Source§

impl Key for HS256

Source§

const ALG: &'static str = "HS256"

Source§

impl Key for IgnoreSignature

Source§

const ALG: &'static str = "WARNING! This should never appear in the 'alg' field of a JWT."

Source§

impl Key for RS256Sk

Source§

const ALG: &'static str = RS256Vk::ALG

Source§

impl Key for RS256Vk

Source§

const ALG: &'static str = "RS256"