Struct identity_iota::client::PresentationValidator
source · [−]#[non_exhaustive]pub struct PresentationValidator;
Expand description
A struct for validating Presentation
s.
Implementations
sourceimpl PresentationValidator
impl PresentationValidator
sourcepub fn validate<U, V, D>(
presentation: &Presentation<U, V>,
holder: &D,
issuers: &[D],
options: &PresentationValidationOptions,
fail_fast: FailFast
) -> Result<(), CompoundPresentationValidationError> where
U: Serialize,
V: Serialize,
D: AsRef<IotaDocument>,
pub fn validate<U, V, D>(
presentation: &Presentation<U, V>,
holder: &D,
issuers: &[D],
options: &PresentationValidationOptions,
fail_fast: FailFast
) -> Result<(), CompoundPresentationValidationError> where
U: Serialize,
V: Serialize,
D: AsRef<IotaDocument>,
Validate a Presentation
.
The following properties are validated according to options
:
- the semantic structure of the presentation,
- the holder’s signature,
- the relationship between the holder and the credential subjects,
- the signatures and some properties of the constituent credentials (see
CredentialValidator::validate
).
Warning
The lack of an error returned from this method is in of itself not enough to conclude that the presentation can be trusted. This section contains more information on additional checks that should be carried out before and after calling this method.
The state of the supplied DID Documents.
The caller must ensure that the DID Documents in holder
and issuers
are up-to-date. The convenience methods
Resolver::resolve_presentation_holder
and Resolver::resolve_presentation_issuers
can help extract the latest available states of these DID Documents.
Properties that are not validated
There are many properties defined in The Verifiable Credentials Data Model that are not validated, such as:
credentialStatus
, type
, credentialSchema
, refreshService
, and more.
These should be manually checked after validation, according to your requirements.
Errors
An error is returned whenever a validated condition is not satisfied.
sourcepub fn verify_presentation_signature<U, V, D>(
presentation: &Presentation<U, V>,
holder: &D,
options: &VerifierOptions
) -> Result<(), ValidationError> where
U: Serialize,
V: Serialize,
D: AsRef<IotaDocument>,
pub fn verify_presentation_signature<U, V, D>(
presentation: &Presentation<U, V>,
holder: &D,
options: &VerifierOptions
) -> Result<(), ValidationError> where
U: Serialize,
V: Serialize,
D: AsRef<IotaDocument>,
Verify the presentation’s signature using the resolved document of the holder.
Warning
The caller must ensure that the DID Document of the holder is up-to-date.
Errors
Fails if the holder
does not match the presentation
’s holder property.
Fails if signature verification against the holder document fails.
sourcepub fn check_structure<U, V>(
presentation: &Presentation<U, V>
) -> Result<(), ValidationError>
pub fn check_structure<U, V>(
presentation: &Presentation<U, V>
) -> Result<(), ValidationError>
Validates the semantic structure of the Presentation.
Trait Implementations
sourceimpl Clone for PresentationValidator
impl Clone for PresentationValidator
sourcefn clone(&self) -> PresentationValidator
fn clone(&self) -> PresentationValidator
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for PresentationValidator
impl Send for PresentationValidator
impl Sync for PresentationValidator
impl Unpin for PresentationValidator
impl UnwindSafe for PresentationValidator
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more