pub struct SdJwtCredentialValidator<R, V = DefaultVerifier> { /* private fields */ }Available on crate feature
sd-jwt only.Expand description
Validates SD-JWT credentials; see the module documentation for the checks.
Implementations§
Source§impl<R: KeyResolver, V: JwsVerifier> SdJwtCredentialValidator<R, V>
impl<R: KeyResolver, V: JwsVerifier> SdJwtCredentialValidator<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 with_status_check(self, check: impl StatusCheck + 'static) -> Self
pub fn with_status_check(self, check: impl StatusCheck + 'static) -> Self
This validator checking the status claim and, for a VCDM 2.0 credential, the
credentialStatus entries with check.
Sourcepub fn has_status_check(&self) -> bool
pub fn has_status_check(&self) -> bool
Whether a status check is configured.
Sourcepub async fn validate(
&self,
sd_jwt: &SdJwt,
options: &SdJwtValidationOptions,
) -> Result<ValidatedSdJwtVc, SdJwtValidationError>
pub async fn validate( &self, sd_jwt: &SdJwt, options: &SdJwtValidationOptions, ) -> Result<ValidatedSdJwtVc, SdJwtValidationError>
Validates sd_jwt as an SD-JWT VC.
§Errors
The first SdJwtValidationError found, in the order the module
documentation lists the checks.
Sourcepub async fn validate_credential(
&self,
credential: SdJwtVc,
options: &SdJwtValidationOptions,
) -> Result<ValidatedSdJwtVc, SdJwtValidationError>
pub async fn validate_credential( &self, credential: SdJwtVc, options: &SdJwtValidationOptions, ) -> Result<ValidatedSdJwtVc, SdJwtValidationError>
Sourcepub async fn validate_v2(
&self,
sd_jwt: &SdJwt,
options: &SdJwtValidationOptions,
) -> Result<ValidatedSdJwtCredentialV2, SdJwtValidationError>
pub async fn validate_v2( &self, sd_jwt: &SdJwt, options: &SdJwtValidationOptions, ) -> Result<ValidatedSdJwtCredentialV2, SdJwtValidationError>
Validates sd_jwt as a VCDM 2.0 credential secured with SD-JWT (VC-JOSE-COSE §3.2.1).
§Errors
The first SdJwtValidationError found, in the order the module
documentation lists the checks.
Sourcepub async fn validate_credential_v2(
&self,
credential: SdJwtCredentialV2,
options: &SdJwtValidationOptions,
) -> Result<ValidatedSdJwtCredentialV2, SdJwtValidationError>
pub async fn validate_credential_v2( &self, credential: SdJwtCredentialV2, options: &SdJwtValidationOptions, ) -> Result<ValidatedSdJwtCredentialV2, SdJwtValidationError>
Trait Implementations§
Auto Trait Implementations§
impl<R, V = DefaultVerifier> !RefUnwindSafe for SdJwtCredentialValidator<R, V>
impl<R, V = DefaultVerifier> !UnwindSafe for SdJwtCredentialValidator<R, V>
impl<R, V> Freeze for SdJwtCredentialValidator<R, V>
impl<R, V> Send for SdJwtCredentialValidator<R, V>
impl<R, V> Sync for SdJwtCredentialValidator<R, V>
impl<R, V> Unpin for SdJwtCredentialValidator<R, V>
impl<R, V> UnsafeUnpin for SdJwtCredentialValidator<R, V>where
R: UnsafeUnpin,
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