Skip to main content

rite_sdk/
lib.rs

1//! Rite SDK: backend abstractions for cryptographic ceremony execution.
2//!
3//! `rite-sdk` is the stable interface layer between the ceremony runtime and
4//! backend implementations. It defines the trait hierarchy, data types, and
5//! error taxonomy that all backends must implement.
6//!
7//! # Implementing a backend
8//!
9//! Implement [`Backend`] and any combination of capability traits matching
10//! your hardware or software capabilities. Use the [`backend_capabilities!`]
11//! macro to reduce boilerplate for the upcasting methods.
12//!
13//! # Trait composition
14//!
15//! Backends implement only the traits matching their capabilities:
16//!
17//! | Backend type      | Typical capabilities                          |
18//! |-------------------|-----------------------------------------------|
19//! | Software          | `KeyStore + Sign + KeyTransport`              |
20//! | YubiKey PIV       | `KeyStore + Sign + Piv + Yubikey`             |
21//! | PKCS#11 HSM       | `KeyStore + Sign + KeyTransport + Pkcs11`     |
22//! | TPM 2.0           | `KeyStore + Sign + Tpm`                       |
23//! | Mock (testing)    | All traits                                    |
24
25#![warn(missing_docs)]
26
27mod backend;
28mod types;
29
30pub use backend::{
31    AttestationBackend, Backend, BackendError, CertStoreBackend, KeyStoreBackend,
32    KeyTransportBackend, PivBackend, Pkcs11AdminBackend, Pkcs11Backend, RandomBackend,
33    Retriability, SignBackend, TpmBackend, YubikeyBackend,
34};
35
36pub use types::{
37    Attestation, AttestationKind, BackendConfig, CertRef, DeviceInfo, KeyAlgorithm, KeyId,
38    KeyMetadata, KeyPolicy, KeySecurityAttributes, KeySpec, KeyUsages, ParseError, PcrValue,
39    PivDeviceInfo, PivKeyOrigin, PivPinPolicy, PivSlot, PivSlotInfo, PivTouchPolicy,
40    Pkcs11Mechanism, Pkcs11TokenFlags, Pkcs11TokenInfo, SignAlgorithm, TpmInfo, WrapAlgorithm,
41    WrappedKey, WrappedKeyFormat, YubikeySlotMetadata,
42};