Struct jsonwebtoken::DecodingKey [−][src]
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]
fn clone(&self) -> DecodingKey
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for DecodingKey
[src]
impl PartialEq<DecodingKey> for DecodingKey
[src]
fn eq(&self, other: &DecodingKey) -> bool
[src]
fn ne(&self, other: &DecodingKey) -> bool
[src]
impl StructuralPartialEq for DecodingKey
[src]
Auto Trait Implementations
impl RefUnwindSafe for DecodingKey
impl Send for DecodingKey
impl Sync for DecodingKey
impl Unpin for DecodingKey
impl UnwindSafe for DecodingKey
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,