Skip to main content

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`, `Jwt`, `SdJwt`, `TypeMetadata` and
27//!   `StatusType`.
28//! - `test-vectors`: [`keys::testsuite`], the behavioural suite every key store must pass, and
29//!   [`vectors`], the specification vectors the tests of this crate run against.
30#![cfg_attr(docsrs, feature(doc_cfg))]
31
32mod cause;
33pub mod did;
34#[cfg(feature = "domain-linkage")]
35#[cfg_attr(docsrs, doc(cfg(feature = "domain-linkage")))]
36pub mod domain_linkage;
37pub mod identity;
38pub mod jose;
39pub mod keys;
40#[cfg(feature = "linked-vp")]
41#[cfg_attr(docsrs, doc(cfg(feature = "linked-vp")))]
42pub mod linked_vp;
43#[cfg(any(feature = "did-key", feature = "did-jwk", feature = "did-web"))]
44#[cfg_attr(
45    docsrs,
46    doc(cfg(any(feature = "did-key", feature = "did-jwk", feature = "did-web")))
47)]
48pub mod methods;
49#[cfg(feature = "utoipa")]
50mod openapi;
51pub mod prelude;
52pub mod resolver;
53#[cfg(feature = "sd-jwt")]
54#[cfg_attr(docsrs, doc(cfg(feature = "sd-jwt")))]
55pub mod sd_jwt_vc;
56#[cfg(feature = "status-list")]
57#[cfg_attr(docsrs, doc(cfg(feature = "status-list")))]
58pub mod status_list;
59#[cfg(feature = "vc")]
60#[cfg_attr(docsrs, doc(cfg(feature = "vc")))]
61pub mod vc;
62#[cfg(feature = "test-vectors")]
63#[cfg_attr(docsrs, doc(cfg(feature = "test-vectors")))]
64pub mod vectors;