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, T> Freeze for Validator<'a, A, T>where
A: ?Sized,
impl<'a, A, T> RefUnwindSafe for Validator<'a, A, T>
impl<'a, A, T> Send for Validator<'a, A, T>
impl<'a, A, T> Sync for Validator<'a, A, T>
impl<'a, A, T> Unpin for Validator<'a, A, T>where
A: ?Sized,
impl<'a, A, 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
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)