ades/lib.rs
1#![forbid(unsafe_code)]
2#![deny(clippy::all)]
3#![deny(missing_docs)]
4
5//! AdES (Advanced Electronic Signatures) for the eIDAS 2.0 ecosystem.
6//!
7//! ## Supported formats
8//!
9//! | Format | Level | Status |
10//! |--------|-------|--------|
11//! | CAdES | B-B | M1 — in development |
12//! | PAdES | B-B | M2 — planned |
13//!
14//! ## RustCrypto compatibility
15//!
16//! The [`signer::Signer`] trait is designed to be compatible with
17//! RustCrypto's `DigestSigner` pattern: only the pre-computed digest is
18//! passed to the signing function, so the private key never needs to be
19//! extracted from hardware tokens (DNIe, HSM, WebCrypto).
20//!
21//! ## Quick start
22//!
23//! ```no_run
24//! use ades::cades;
25//! use ades::signer::SoftSigner;
26//!
27//! let signer = SoftSigner::generate(2048).unwrap();
28//! let signed = cades::sign(b"hello world", &signer).unwrap();
29//! ```
30
31/// X.509 certificate wrapper.
32pub mod certificate;
33/// Shared CMS/PKCS#7 utilities (signature algorithm derivation).
34pub(crate) mod cms;
35/// Digest algorithm abstractions.
36pub mod digest;
37/// Error types.
38pub mod error;
39/// Signer trait and software backend.
40pub mod signer;
41
42/// CAdES (CMS Advanced Electronic Signatures).
43#[cfg(feature = "cades")]
44pub mod cades;
45
46/// PAdES (PDF Advanced Electronic Signatures).
47#[cfg(feature = "pades")]
48pub mod pades;
49
50/// TSP (Time-Stamp Protocol, RFC 3161) client.
51pub mod tsp;
52
53/// OCSP (Online Certificate Status Protocol, RFC 6960) client.
54pub mod ocsp;
55
56/// AdES signature level upgrades (B-T, B-LT, B-LTA).
57pub mod levels;
58
59/// PKCS#11 signing backend (DNIe, smart cards, HSMs).
60#[cfg(feature = "pkcs11")]
61pub mod pkcs11;
62
63/// XAdES (XML Advanced Electronic Signatures).
64#[cfg(feature = "xades")]
65pub mod xades;
66
67/// JAdES (JSON Advanced Electronic Signatures).
68#[cfg(feature = "jades")]
69pub mod jades;
70
71pub use certificate::Certificate;
72pub use digest::DigestAlgorithm;
73pub use error::AdesError;