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§
Sourcefn encoding_key(&self) -> EncodingKey
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).
Sourcefn decoding_key(&self) -> DecodingKey
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.
impl JwtKeyExt for EcdsaKeyPair
Available on crate feature
ecdsa only.fn encoding_key(&self) -> EncodingKey
fn decoding_key(&self) -> DecodingKey
Source§impl JwtKeyExt for Ed25519KeyPair
Available on crate feature ed25519 only.
impl JwtKeyExt for Ed25519KeyPair
Available on crate feature
ed25519 only.fn encoding_key(&self) -> EncodingKey
fn decoding_key(&self) -> DecodingKey
Source§impl JwtKeyExt for HmacSecret
Available on crate feature hmac only.
impl JwtKeyExt for HmacSecret
Available on crate feature
hmac only.fn encoding_key(&self) -> EncodingKey
fn decoding_key(&self) -> DecodingKey
Source§impl JwtKeyExt for RsaKeyPair
Available on crate feature rsa only.
impl JwtKeyExt for RsaKeyPair
Available on crate feature
rsa only.