identity_kit/lib.rs
1//! DID, key management and verifiable credential primitives.
2//!
3//! The crate is organised in two layers. The lower layer holds the DID data model ([`did`]), JOSE
4//! keys and signatures ([`jose`]), key stores ([`keys`]), the signing party ([`identity`]), DID
5//! resolution and dereferencing ([`resolver`]) and the `did:key`, `did:jwk` and `did:web`
6//! methods ([`methods`]). The upper layer builds JWT-based verifiable credentials and
7//! presentations on top of it ([`vc`]), SD-JWT verifiable credentials ([`sd_jwt_vc`]), the IETF
8//! Token Status List ([`status_list`]), the DIF Well Known DID Configuration
9//! ([`domain_linkage`]) and DIF Linked Verifiable Presentations ([`linked_vp`]), and never leaks
10//! back into the lower layer. [`prelude`] gathers the common types of the lower layer,
11//! [`prelude::credentials`] those of the upper layer.
12//!
13//! # Cargo features
14//!
15//! All features are additive. The default set enables both layers over software keys and the
16//! three DID methods; `--no-default-features` leaves the lower layer with the in-crate
17//! parsers and verifiers only. The complete list, with what each feature pulls in, is in the
18//! crate's `docs/DESIGN.md`. `status-list` enables [`status_list`] on its own, so a build with
19//! `vc` but without `sd-jwt` checks the `status` claim of JWT credentials too; `sd-jwt` implies
20//! it. The features that add surface rather than enable a module:
21//!
22//! - `utoipa`: OpenAPI schemas ([`utoipa::ToSchema`]) for [`DidDocument`](did::DidDocument),
23//! [`VerificationMethod`](did::VerificationMethod), [`Service`](did::Service),
24//! [`Jwk`](jose::Jwk), [`JwsAlgorithm`](jose::JwsAlgorithm), the credentials and
25//! presentations of `vc` (VCDM 1.1 and 2.0, enveloped forms included),
26//! `DomainLinkageConfiguration`, `ClaimPath`, `TypeMetadata` and `StatusType`.
27//! - `test-vectors`: [`keys::testsuite`], the behavioural suite every key store must pass, and
28//! [`vectors`], the specification vectors the tests of this crate run against.
29#![cfg_attr(docsrs, feature(doc_cfg))]
30
31mod cause;
32pub mod did;
33#[cfg(feature = "domain-linkage")]
34#[cfg_attr(docsrs, doc(cfg(feature = "domain-linkage")))]
35pub mod domain_linkage;
36pub mod identity;
37pub mod jose;
38pub mod keys;
39#[cfg(feature = "linked-vp")]
40#[cfg_attr(docsrs, doc(cfg(feature = "linked-vp")))]
41pub mod linked_vp;
42#[cfg(any(feature = "did-key", feature = "did-jwk", feature = "did-web"))]
43#[cfg_attr(
44 docsrs,
45 doc(cfg(any(feature = "did-key", feature = "did-jwk", feature = "did-web")))
46)]
47pub mod methods;
48#[cfg(feature = "utoipa")]
49mod openapi;
50pub mod prelude;
51pub mod resolver;
52#[cfg(feature = "sd-jwt")]
53#[cfg_attr(docsrs, doc(cfg(feature = "sd-jwt")))]
54pub mod sd_jwt_vc;
55#[cfg(feature = "status-list")]
56#[cfg_attr(docsrs, doc(cfg(feature = "status-list")))]
57pub mod status_list;
58#[cfg(feature = "vc")]
59#[cfg_attr(docsrs, doc(cfg(feature = "vc")))]
60pub mod vc;
61#[cfg(feature = "test-vectors")]
62#[cfg_attr(docsrs, doc(cfg(feature = "test-vectors")))]
63pub mod vectors;