pub struct JWKDecodingKeySet { /* private fields */ }
Implementations§
Source§impl JWKDecodingKeySet
impl JWKDecodingKeySet
pub fn new() -> JWKDecodingKeySet
pub fn clear_keys(&mut self)
Sourcepub fn keys_by_id(&self, kid: String) -> Vec<JWKDecodingKey>
pub fn keys_by_id(&self, kid: String) -> Vec<JWKDecodingKey>
Fetch a key by key id (KID)
Sourcepub fn add_key(&mut self, key: JWKDecodingKey)
pub fn add_key(&mut self, key: JWKDecodingKey)
Manually add a key to the keystore
Sourcepub fn verify<T: DeserializeOwned>(
&self,
token: &str,
validation: &Validation,
) -> Result<TokenData<T>>
pub fn verify<T: DeserializeOwned>( &self, token: &str, validation: &Validation, ) -> Result<TokenData<T>>
Verify a JWT token. If the token is valid, it is returned.
A token is considered valid if:
- Is well formed
- Has a
kid
field that matches a public signature `kid - Signature matches public key
- It is not expired
- The
nbf
is not set to before now
Trait Implementations§
Source§impl Clone for JWKDecodingKeySet
impl Clone for JWKDecodingKeySet
Source§fn clone(&self) -> JWKDecodingKeySet
fn clone(&self) -> JWKDecodingKeySet
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 Default for JWKDecodingKeySet
impl Default for JWKDecodingKeySet
Auto Trait Implementations§
impl Freeze for JWKDecodingKeySet
impl RefUnwindSafe for JWKDecodingKeySet
impl Send for JWKDecodingKeySet
impl Sync for JWKDecodingKeySet
impl Unpin for JWKDecodingKeySet
impl UnwindSafe for JWKDecodingKeySet
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