pub enum DecodingKey {
Hmac(Vec<u8>),
Rsa(RsaPublicKey),
}
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
Variants§
Hmac(Vec<u8>)
Rsa(RsaPublicKey)
Implementations§
Source§impl DecodingKey
impl DecodingKey
Sourcepub fn from_hmac_secret(secret: &[u8]) -> Self
pub fn from_hmac_secret(secret: &[u8]) -> Self
If you’re using HMAC, use this.
Sourcepub fn from_base64_hmac_secret(secret: &str) -> Result<Self>
pub fn from_base64_hmac_secret(secret: &str) -> Result<Self>
If you’re using HMAC with a base64 encoded, use this.
pub fn from_rsa(key: RsaPublicKey) -> Result<Self>
Sourcepub fn from_rsa_components(n: &str, e: &str) -> Result<Self>
pub fn from_rsa_components(n: &str, e: &str) -> Result<Self>
Convenience function for JWKS implementors
Trait Implementations§
Source§impl Clone for DecodingKey
impl Clone for DecodingKey
Source§fn clone(&self) -> DecodingKey
fn clone(&self) -> DecodingKey
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for DecodingKey
impl Debug for DecodingKey
Source§impl PartialEq for DecodingKey
impl PartialEq for DecodingKey
impl StructuralPartialEq for DecodingKey
Auto Trait Implementations§
impl Freeze for DecodingKey
impl RefUnwindSafe for DecodingKey
impl Send for DecodingKey
impl Sync for DecodingKey
impl Unpin for DecodingKey
impl UnwindSafe for DecodingKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more