pub struct JwtPresentationValidator<R, V = DefaultVerifier> { /* private fields */ }Available on crate feature
vc only.Expand description
Validates presentation JWTs and the credential JWTs they carry, see the module documentation for the checks.
Built over a JwtCredentialValidator, which validates the credentials with the same key
resolver, verifier and status check.
Implementations§
Source§impl<R: KeyResolver, V: JwsVerifier> JwtPresentationValidator<R, V>
impl<R: KeyResolver, V: JwsVerifier> JwtPresentationValidator<R, V>
Sourcepub fn new(resolver: R, verifier: V) -> Self
pub fn new(resolver: R, verifier: V) -> Self
A validator resolving keys with resolver and verifying signatures with verifier,
without a status check.
Sourcepub fn from_credential_validator(
credentials: JwtCredentialValidator<R, V>,
) -> Self
pub fn from_credential_validator( credentials: JwtCredentialValidator<R, V>, ) -> Self
A validator over credentials, sharing its resolver, verifier and status check.
Sourcepub fn with_status_check(self, check: impl StatusCheck + 'static) -> Self
pub fn with_status_check(self, check: impl StatusCheck + 'static) -> Self
This validator checking credentialStatus with check.
Sourcepub fn credential_validator(&self) -> &JwtCredentialValidator<R, V>
pub fn credential_validator(&self) -> &JwtCredentialValidator<R, V>
The credential validator.
Sourcepub async fn validate(
&self,
jwt: &Jwt,
options: &PresentationValidationOptions,
) -> Result<DecodedPresentation, PresentationValidationError>
pub async fn validate( &self, jwt: &Jwt, options: &PresentationValidationOptions, ) -> Result<DecodedPresentation, PresentationValidationError>
Validates a presentation JWT and every credential it carries.
§Errors
A PresentationValidationError naming what failed: the presentation (in which case
no credential was validated), or the credentials that failed, all of them under
FailFast::AllErrors.
Trait Implementations§
Auto Trait Implementations§
impl<R, V = DefaultVerifier> !RefUnwindSafe for JwtPresentationValidator<R, V>
impl<R, V = DefaultVerifier> !UnwindSafe for JwtPresentationValidator<R, V>
impl<R, V> Freeze for JwtPresentationValidator<R, V>where
JwtCredentialValidator<R, V>: Freeze,
impl<R, V> Send for JwtPresentationValidator<R, V>where
JwtCredentialValidator<R, V>: Send,
impl<R, V> Sync for JwtPresentationValidator<R, V>where
JwtCredentialValidator<R, V>: Sync,
impl<R, V> Unpin for JwtPresentationValidator<R, V>where
JwtCredentialValidator<R, V>: Unpin,
impl<R, V> UnsafeUnpin for JwtPresentationValidator<R, V>where
JwtCredentialValidator<R, V>: UnsafeUnpin,
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