Struct jsonwebtoken::DecodingKey
source · [−]pub struct DecodingKey<'a> { /* 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<'a> DecodingKey<'a>
impl<'a> DecodingKey<'a>
sourcepub fn from_secret(secret: &'a [u8]) -> Self
pub fn from_secret(secret: &'a [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, use this.
sourcepub fn from_rsa_pem(key: &'a [u8]) -> Result<Self>
pub fn from_rsa_pem(key: &'a [u8]) -> Result<Self>
If you are loading a public RSA key in a PEM format, use this.
sourcepub fn from_rsa_components(modulus: &'a str, exponent: &'a str) -> Self
pub fn from_rsa_components(modulus: &'a str, exponent: &'a str) -> Self
If you have (n, e) RSA public key components, use this.
sourcepub fn from_ec_pem(key: &'a [u8]) -> Result<Self>
pub fn from_ec_pem(key: &'a [u8]) -> Result<Self>
If you have a ECDSA public key in PEM format, use this.
sourcepub fn from_rsa_der(der: &'a [u8]) -> Self
pub fn from_rsa_der(der: &'a [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: &'a [u8]) -> Self
pub fn from_ec_der(der: &'a [u8]) -> Self
If you know what you’re doing and have a RSA EC encoded public key, use this.
sourcepub fn into_static(self) -> DecodingKey<'static>
pub fn into_static(self) -> DecodingKey<'static>
Convert self to DecodingKey<'static>
.
Trait Implementations
sourceimpl<'a> Clone for DecodingKey<'a>
impl<'a> Clone for DecodingKey<'a>
sourcefn clone(&self) -> DecodingKey<'a>
fn clone(&self) -> DecodingKey<'a>
Returns a copy of the value. Read more
1.0.0const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<'a> Debug for DecodingKey<'a>
impl<'a> Debug for DecodingKey<'a>
sourceimpl<'a> PartialEq<DecodingKey<'a>> for DecodingKey<'a>
impl<'a> PartialEq<DecodingKey<'a>> for DecodingKey<'a>
sourcefn eq(&self, other: &DecodingKey<'a>) -> bool
fn eq(&self, other: &DecodingKey<'a>) -> bool
impl<'a> StructuralPartialEq for DecodingKey<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for DecodingKey<'a>
impl<'a> Send for DecodingKey<'a>
impl<'a> Sync for DecodingKey<'a>
impl<'a> Unpin for DecodingKey<'a>
impl<'a> UnwindSafe for DecodingKey<'a>
Blanket Implementations
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstablefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ToOwned for Twhere
T: Clone,
impl<T> ToOwned for Twhere
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
fn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
Uses borrowed data to replace owned data, usually by cloning. Read more