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 DIF
8//! Well Known DID Configuration ([`domain_linkage`]) and DIF Linked Verifiable Presentations
9//! ([`linked_vp`]), and never leaks back into the lower layer. [`prelude`] gathers the common
10//! types of the lower layer, [`prelude::credentials`] those of the upper layer.
11//!
12//! # Cargo features
13//!
14//! All features are additive. The default set enables both layers over software keys and the
15//! three DID methods; `--no-default-features` leaves the lower layer with the in-crate
16//! parsers and verifiers only. The complete list, with what each feature pulls in, is in the
17//! crate's `docs/DESIGN.md`; the ones that add surface rather than enable a module:
18//!
19//! - `utoipa`: OpenAPI schemas ([`utoipa::ToSchema`]) for [`DidDocument`](did::DidDocument),
20//!   [`VerificationMethod`](did::VerificationMethod), [`Service`](did::Service),
21//!   [`Jwk`](jose::Jwk), `DomainLinkageConfiguration` and `TypeMetadata`.
22//! - `test-vectors`: [`keys::testsuite`], the behavioural suite every key store must pass, and
23//!   [`vectors`], the specification vectors the tests of this crate run against.
24#![cfg_attr(docsrs, feature(doc_cfg))]
25
26pub mod did;
27#[cfg(feature = "domain-linkage")]
28#[cfg_attr(docsrs, doc(cfg(feature = "domain-linkage")))]
29pub mod domain_linkage;
30pub mod identity;
31pub mod jose;
32pub mod keys;
33#[cfg(feature = "linked-vp")]
34#[cfg_attr(docsrs, doc(cfg(feature = "linked-vp")))]
35pub mod linked_vp;
36#[cfg(any(feature = "did-key", feature = "did-jwk", feature = "did-web"))]
37#[cfg_attr(
38    docsrs,
39    doc(cfg(any(feature = "did-key", feature = "did-jwk", feature = "did-web")))
40)]
41pub mod methods;
42#[cfg(feature = "utoipa")]
43mod openapi;
44pub mod prelude;
45pub mod resolver;
46#[cfg(feature = "sd-jwt")]
47#[cfg_attr(docsrs, doc(cfg(feature = "sd-jwt")))]
48pub mod sd_jwt_vc;
49#[cfg(feature = "vc")]
50#[cfg_attr(docsrs, doc(cfg(feature = "vc")))]
51pub mod vc;
52#[cfg(feature = "test-vectors")]
53#[cfg_attr(docsrs, doc(cfg(feature = "test-vectors")))]
54pub mod vectors;