Skip to main content

Crate affinidi_vc

Crate affinidi_vc 

Source
Expand description

W3C Verifiable Credentials Data Model implementation.

Supports both VCDM 1.1 and VCDM 2.0.

§Overview

This crate provides the core data types for Verifiable Credentials:

§Proof Format Agnostic

The data model is independent of the proof/signature format. Credentials can be secured using:

  • Data Integrity proofs (embedded in the proof field)
  • JWT (external envelope)
  • SD-JWT VC (selective disclosure with external envelope)
  • COSE (for mdoc/mDL)

§Version Detection

The VCDM version is automatically detected from the @context array:

  • https://www.w3.org/2018/credentials/v1 → VCDM 1.1
  • https://www.w3.org/ns/credentials/v2 → VCDM 2.0

Re-exports§

pub use context::CREDENTIALS_V1_CONTEXT;
pub use context::CREDENTIALS_V2_CONTEXT;
pub use credential::ContextValue;
pub use credential::CredentialBuilder;
pub use credential::CredentialStatus;
pub use credential::IssuerValue;
pub use credential::SubjectValue;
pub use credential::VerifiableCredential;
pub use error::VcError;
pub use presentation::PresentationBuilder;
pub use presentation::VerifiablePresentation;

Modules§

context
JSON-LD context constants and validation for Verifiable Credentials.
credential
Verifiable Credential types supporting both VCDM 1.1 and 2.0.
error
Verifiable Credential error types.
presentation
Verifiable Presentation types for W3C VCDM 1.1 and 2.0.