Struct jwt_compact::Validator
source · pub struct Validator<'a, A: Algorithm + ?Sized, T> { /* private fields */ }
Expand description
Validator for a certain signing Algorithm
associated with a specific verifying key
and a claims type. Produced by the AlgorithmExt::validator()
method.
Implementations§
source§impl<A: Algorithm + ?Sized, T: DeserializeOwned> Validator<'_, A, T>
impl<A: Algorithm + ?Sized, T: DeserializeOwned> Validator<'_, A, T>
sourcepub fn validate<H: Clone>(
self,
token: &UntrustedToken<'_, H>
) -> Result<Token<T, H>, ValidationError>
pub fn validate<H: Clone>( self, token: &UntrustedToken<'_, H> ) -> Result<Token<T, H>, ValidationError>
Validates the token integrity against a verifying key enclosed in this validator.
sourcepub fn validate_for_signed_token<H: Clone>(
self,
token: &UntrustedToken<'_, H>
) -> Result<SignedToken<A, T, H>, ValidationError>
pub fn validate_for_signed_token<H: Clone>( self, token: &UntrustedToken<'_, H> ) -> Result<SignedToken<A, T, H>, ValidationError>
Validates the token integrity against a verifying key enclosed in this validator,
and returns the validated Token
together with its signature.
Trait Implementations§
source§impl<'a, A: Debug + Algorithm + ?Sized, T: Debug> Debug for Validator<'a, A, T>where
A::VerifyingKey: Debug,
impl<'a, A: Debug + Algorithm + ?Sized, T: Debug> Debug for Validator<'a, A, T>where
A::VerifyingKey: Debug,
impl<A: Algorithm + ?Sized, T> Copy for Validator<'_, A, T>
Auto Trait Implementations§
impl<'a, A: ?Sized, T> RefUnwindSafe for Validator<'a, A, T>
impl<'a, A: ?Sized, T> Send for Validator<'a, A, T>
impl<'a, A: ?Sized, T> Sync for Validator<'a, A, T>
impl<'a, A: ?Sized, T> Unpin for Validator<'a, A, T>
impl<'a, A: ?Sized, T> UnwindSafe for Validator<'a, A, T>
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