#[non_exhaustive]pub struct PresentationValidationOptions {
pub time: TimeOptions,
pub audience: Option<String>,
pub nonce: Option<String>,
pub subject_holder: SubjectHolderRelationship,
pub credentials: CredentialValidationOptions,
pub fail_fast: FailFast,
pub additional_typ: BTreeSet<String>,
pub key_binding: Option<KeyBindingOptions>,
}vc only.Expand description
Options of JwtPresentationValidator.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.time: TimeOptionsThe validation time and leeway of the presentation JWT.
audience: Option<String>The audience the presentation must name in aud, if any is required.
nonce: Option<String>The nonce the presentation must carry, if one is required.
subject_holder: SubjectHolderRelationshipHow credential subjects must relate to the holder.
credentials: CredentialValidationOptionsThe options every presented credential is validated with.
fail_fast: FailFastWhether to stop at the first failing credential.
additional_typ: BTreeSet<String>Header typ values accepted for the presentation JWT besides the profile’s own (JWT
for VCDM 1.1, vp+jwt for VCDM 2.0), by both profiles; none by default. A token
without typ is always accepted. The credentials’ own are
CredentialValidationOptions::additional_typ.
key_binding: Option<KeyBindingOptions>sd-jwt only.The key binding every enveloped credential secured with SD-JWT must prove, if any
is required; none by default, since the presentation JWT already proves holder
control. See JwtPresentationValidator::validate_v2.
Implementations§
Source§impl PresentationValidationOptions
impl PresentationValidationOptions
Sourcepub fn new() -> Self
pub fn new() -> Self
Default options: validate now without leeway, no audience or nonce required,
SubjectHolderRelationship::AlwaysSubject, default credential options,
FailFast::FirstError.
Sourcepub fn with_time(self, time: TimeOptions) -> Self
pub fn with_time(self, time: TimeOptions) -> Self
These options with time, for the presentation JWT only.
Sourcepub fn with_audience(self, audience: impl Into<String>) -> Self
pub fn with_audience(self, audience: impl Into<String>) -> Self
These options requiring audience.
Sourcepub fn with_nonce(self, nonce: impl Into<String>) -> Self
pub fn with_nonce(self, nonce: impl Into<String>) -> Self
These options requiring nonce.
Sourcepub fn with_subject_holder(
self,
relationship: SubjectHolderRelationship,
) -> Self
pub fn with_subject_holder( self, relationship: SubjectHolderRelationship, ) -> Self
These options with relationship.
Sourcepub fn with_credentials(self, credentials: CredentialValidationOptions) -> Self
pub fn with_credentials(self, credentials: CredentialValidationOptions) -> Self
These options validating credentials with credentials.
Sourcepub fn with_fail_fast(self, fail_fast: FailFast) -> Self
pub fn with_fail_fast(self, fail_fast: FailFast) -> Self
These options with fail_fast.
Sourcepub fn with_additional_typ(self, typ: impl Into<String>) -> Self
pub fn with_additional_typ(self, typ: impl Into<String>) -> Self
These options also accepting a presentation whose header typ is typ.
Sourcepub fn with_key_binding(self, key_binding: KeyBindingOptions) -> Self
Available on crate feature sd-jwt only.
pub fn with_key_binding(self, key_binding: KeyBindingOptions) -> Self
sd-jwt only.These options requiring key_binding of every enveloped credential secured with
SD-JWT.
Trait Implementations§
impl Eq for PresentationValidationOptions
impl StructuralPartialEq for PresentationValidationOptions
Auto Trait Implementations§
impl Freeze for PresentationValidationOptions
impl RefUnwindSafe for PresentationValidationOptions
impl Send for PresentationValidationOptions
impl Sync for PresentationValidationOptions
impl Unpin for PresentationValidationOptions
impl UnsafeUnpin for PresentationValidationOptions
impl UnwindSafe for PresentationValidationOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.