Struct jsonwebtoken::DecodingKey
source · [−]pub struct DecodingKey { /* private fields */ }
Expand description
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
sourceimpl DecodingKey
impl DecodingKey
sourcepub fn from_secret(secret: &[u8]) -> Self
pub fn from_secret(secret: &[u8]) -> Self
If you’re using HMAC, use this.
sourcepub fn from_base64_secret(secret: &str) -> Result<Self>
pub fn from_base64_secret(secret: &str) -> Result<Self>
If you’re using HMAC with a base64 encoded secret, use this.
sourcepub fn from_rsa_components(modulus: &str, exponent: &str) -> Result<Self>
pub fn from_rsa_components(modulus: &str, exponent: &str) -> Result<Self>
If you have (n, e) RSA public key components as strings, use this.
sourcepub fn from_rsa_raw_components(modulus: &[u8], exponent: &[u8]) -> Self
pub fn from_rsa_raw_components(modulus: &[u8], exponent: &[u8]) -> Self
If you have (n, e) RSA public key components already decoded, use this.
sourcepub fn from_rsa_der(der: &[u8]) -> Self
pub fn from_rsa_der(der: &[u8]) -> Self
If you know what you’re doing and have a RSA DER encoded public key, use this.
sourcepub fn from_ec_der(der: &[u8]) -> Self
pub fn from_ec_der(der: &[u8]) -> Self
If you know what you’re doing and have a RSA EC encoded public key, use this.
sourcepub fn from_ed_der(der: &[u8]) -> Self
pub fn from_ed_der(der: &[u8]) -> Self
If you know what you’re doing and have a Ed DER encoded public key, use this.
Trait Implementations
sourceimpl Clone for DecodingKey
impl Clone for DecodingKey
sourcefn clone(&self) -> DecodingKey
fn clone(&self) -> DecodingKey
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more