Skip to main content

JwtKeyExt

Trait JwtKeyExt 

Source
pub trait JwtKeyExt {
    // Required methods
    fn encoding_key(&self) -> EncodingKey;
    fn decoding_key(&self) -> DecodingKey;
}
Expand description

Extension trait for uselesskey keypairs to produce jsonwebtoken keys.

This trait is implemented for RSA, ECDSA, Ed25519 keypairs, and HMAC secrets when the corresponding features are enabled.

Required Methods§

Source

fn encoding_key(&self) -> EncodingKey

Create a jsonwebtoken::EncodingKey for signing JWTs.

§Panics

Panics if the key cannot be parsed (should not happen with valid uselesskey fixtures).

Source

fn decoding_key(&self) -> DecodingKey

Create a jsonwebtoken::DecodingKey for verifying JWTs.

§Panics

Panics if the key cannot be parsed (should not happen with valid uselesskey fixtures).

Implementations on Foreign Types§

Source§

impl JwtKeyExt for EcdsaKeyPair

Available on crate feature ecdsa only.
Source§

impl JwtKeyExt for Ed25519KeyPair

Available on crate feature ed25519 only.
Source§

impl JwtKeyExt for HmacSecret

Available on crate feature hmac only.
Source§

impl JwtKeyExt for RsaKeyPair

Available on crate feature rsa only.

Implementors§