dpp_vc/lib.rs
1//! `dpp-vc` — the trust layer: who may read a passport, and how that is proven.
2//!
3//! W3C Verifiable Credentials, `did:web` documents, Bitstring Status List
4//! revocation, and the JSON-LD context those are expressed in.
5//!
6//! Pure (no I/O, no network). Not a `wasm32-unknown-unknown` target: it depends
7//! on [`dpp_crypto`], whose RNG requires a platform entropy source.
8//!
9//! # Trust, not primitives, and not policy
10//!
11//! Three neighbouring concerns are deliberately **not** here:
12//!
13//! - **Cryptographic primitives** — JWS, keys, the keystore — are
14//! [`dpp_crypto`], which this crate depends on. Signing bytes is a different
15//! job from deciding whose signature means what.
16//! - **The disclosure contract** — `Audience`, `Disclosure`, the per-field
17//! disclosure map and the filter that applies it — describes what a passport
18//! *is*, not who is asking. It currently lives in `dpp-crypto::access`; its
19//! settled home is `dpp-domain`.
20//! - **Projections** — GS1, AAS — render a passport for an ecosystem. They say
21//! nothing about trust.
22//!
23//! The seam this crate sits on: **a credential establishes which `Audience` a
24//! caller holds; the disclosure policy maps that `Audience` to fields.** Those
25//! are two questions and they are answered in two places.
26
27pub mod credential;
28pub mod did_builder;
29pub mod jsonld;
30pub mod local_service;
31pub mod passport_credential;
32pub mod status_list;
33
34#[cfg(test)]
35mod test_support;
36#[cfg(test)]
37mod tests;
38
39pub use credential::{
40 AllowAllIssuers, Audience, CredentialBuilder, CredentialRole, CredentialStatus,
41 DppAccessCredential, DppCredentialSubject, RevocationOutcome, StaticTrustedIssuers,
42 TrustedIssuerRegistry, VerificationResult, check_revocation, verify_credential_claims,
43 verify_credential_claims_with_trust, verify_credential_with_revocation,
44 verify_credential_with_revocation_and_trust,
45};
46pub use did_builder::build_did_document;
47pub use jsonld::{REMOTE_CONTEXTS, context_value, frame_passport, passport_context, strip_context};
48pub use local_service::LocalIdentityService;
49pub use passport_credential::{PassportCredential, PassportCredentialSubject};
50pub use status_list::StatusList;
51
52/// Compile-checks this crate's README examples.
53///
54/// A README example is a public claim about the API, and nothing else in the
55/// build compiles one. Without this, a README can advertise a function that
56/// does not exist — which is exactly what happened before this harness landed.
57#[cfg(doctest)]
58#[doc = include_str!("../README.md")]
59struct ReadmeDoctests;