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