1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! # pdf_signer
//!
//! Pure-Rust, self-contained library to **digitally sign** (PAdES) and
//! **verify** PDF documents with a PKCS#12 (`.p12`/`.pfx`) keystore. It replaces
//! the bundled `BatchPDFSignPortable.jar` (Java/PDFBox) used by the R package
//! `signer`, removing the Java runtime dependency and the binary blob.
//!
//! ## What it does
//! * [`sign_pdf_file`] / [`sign_pdf_bytes`]: append a signature field (optionally
//! with a visible appearance) and an `ETSI.CAdES.detached` CMS signature as an
//! **incremental update**, so any prior signature stays valid. Targets PAdES
//! B-B through B-LTA (RFC 3161 signature & document timestamps, `/DSS`).
//! * [`verify_pdf_file`] / [`verify_pdf_bytes`]: re-extract the signed byte
//! range, validate the CMS signature cryptographically, check that the
//! document was not modified after the last signature
//! ([`SignatureReport::document_intact`]), report signer info, and optionally
//! validate the signer and TSA chains against a [`TrustStore`].
//!
//! ## Notes
//! * Keys: RSA (PKCS#1 v1.5), ECDSA (P-256/P-384), Ed25519.
//! * 100% pure Rust (RustCrypto) — no OpenSSL, no Java, no system C libraries.
//! An optional `https` feature (ureq/rustls) enables TLS TSA/CRL/OCSP.
//! * Incremental updates support both classic xref tables and xref streams.
//! * Encrypted PDFs and documents certified with DocMDP `P=1` are refused.
//! * The `testkit` feature exposes fixture builders for tests and demos.
pub use Error;
pub use ;
pub use TrustStore;
pub use ;
/// Convenience result type for the crate.
pub type Result<T> = Result;