Trait ssi_claims::VerifiableClaims

source ·
pub trait VerifiableClaims {
    type Claims;
    type Proof;

    // Required methods
    fn claims(&self) -> &Self::Claims;
    fn proof(&self) -> &Self::Proof;

    // Provided method
    async fn verify<P>(
        &self,
        params: P,
    ) -> Result<Result<(), Invalid>, ProofValidationError>
       where Self::Claims: ValidateClaims<P, Self::Proof>,
             Self::Proof: ValidateProof<P, Self::Claims> { ... }
}
Expand description

Verifiable Claims.

Set of claims bundled with a proof.

Required Associated Types§

source

type Claims

Claims type.

source

type Proof

Proof type.

Required Methods§

source

fn claims(&self) -> &Self::Claims

The claims.

source

fn proof(&self) -> &Self::Proof

The proof.

Provided Methods§

source

async fn verify<P>( &self, params: P, ) -> Result<Result<(), Invalid>, ProofValidationError>
where Self::Claims: ValidateClaims<P, Self::Proof>, Self::Proof: ValidateProof<P, Self::Claims>,

Validates the claims and proof.

The params argument provides all the verification parameters required to validate the claims and proof.

§What verification parameters should I use?

It really depends on the claims type Self::Claims and proof type Self::Proof, but the VerificationParameters type is a good starting point that should work most of the time.

§Passing the parameters by reference

If the validation traits are implemented for P, they will be implemented for &P as well. This means the parameters can be passed by move or by reference.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'a, T> VerifiableClaims for DecodedJws<'a, T>

source§

impl<T> VerifiableClaims for DecodedCoseSign1<T>

source§

impl<T, S> VerifiableClaims for DataIntegrity<T, S>

Implementors§