Struct jsonwebtoken::DecodingKey[][src]

pub struct DecodingKey { /* fields omitted */ }

All the different kind of keys we can use to decode a JWT This key can be re-used so make sure you only initialize it once if you can for better performance

Implementations

impl DecodingKey[src]

pub fn from_secret(secret: &[u8]) -> Self[src]

If you’re using HMAC, use this.

pub fn from_base64_secret(secret: &str) -> Result<Self>[src]

If you’re using HMAC with a base64 encoded secret, use this.

pub fn from_rsa_pem(key: &[u8]) -> Result<Self>[src]

If you are loading a public RSA key in a PEM format, use this.

pub fn from_rsa_components(modulus: &str, exponent: &str) -> Result<Self>[src]

If you have (n, e) RSA public key components as strings, use this.

pub fn from_rsa_raw_components(modulus: &[u8], exponent: &[u8]) -> Self[src]

If you have (n, e) RSA public key components already decoded, use this. TODO: do we need that?

pub fn from_ec_pem(key: &[u8]) -> Result<Self>[src]

If you have a ECDSA public key in PEM format, use this.

pub fn from_ed_pem(key: &[u8]) -> Result<Self>[src]

If you have a EdDSA public key in PEM format, use this.

pub fn from_rsa_der(der: &[u8]) -> Self[src]

If you know what you’re doing and have a RSA DER encoded public key, use this.

pub fn from_ec_der(der: &[u8]) -> Self[src]

If you know what you’re doing and have a RSA EC encoded public key, use this.

pub fn from_ed_der(der: &[u8]) -> Self[src]

If you know what you’re doing and have a Ed DER encoded public key, use this.

Trait Implementations

impl Clone for DecodingKey[src]

impl Debug for DecodingKey[src]

impl PartialEq<DecodingKey> for DecodingKey[src]

impl StructuralPartialEq for DecodingKey[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.