Crates.io | vercre-dif-exch |
lib.rs | vercre-dif-exch |
version | 0.1.0-alpha.6 |
source | src |
created_at | 2024-08-08 01:30:05.939349 |
updated_at | 2024-08-08 01:30:05.939349 |
description | An implementation of DIF Presentation Exchange specification. |
homepage | https://vercre.io |
repository | https://github.com/vercre/vercre |
max_upload_size | |
id | 1328945 |
size | 25,975 |
This crate is a higher order crate to support the Vercre suite of crates. It is not intended to be used directly. See
Created to support the DIF Presentation Exchange 2.0.0 this crate contains building
blocks for articulating identity proof requirements (Presentation Definition
) and
the proofs or Claims, submitted in accordance with those requirements
(Presentation Submission
).
As the specification only requires Claims to be serializable as JSON, this crate
provides a serde
-compatible Claim
trait that can be implemented for a variety of
Claim formats. This could include JSON Web Tokens (JWTs), Verifiable Credentials (VCs),
JWT-VCs, etc..
use dif_exch::Claim;
impl Claims for VerifiableCredential {
fn to_json(&self) -> anyhow::Result<serde_json::Value> {
serde_json::to_value(self).map_err(Into::into)
}
}
Presentation Definitions are objects that articulate what proofs a Verifier requires. These help the Verifier to decide how or whether to interact with a Holder. Presentation Definitions are composed of inputs, which describe the forms and details of the proofs they require, and optional sets of selection rules, to allow Holders flexibility in cases where many different types of proofs may satisfy an input requirement.
The Presentation Exchange specification codifies a Presentation Definition data format Verifiers can use to articulate proof requirements, and a Presentation Submission data format Holders can use to describe proofs submitted in accordance with them.
Presentation Submissions are objects embedded within target claim negotiation formats that unify the presentation of proofs to a Verifier in accordance with the requirements a Verifier specified in a Presentation Definition. See Presentation Submission.