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
51
52
53
54
55
//! PDF Digital Signatures module.
//!
//! This module provides functionality for creating and verifying digital signatures
//! in PDF documents according to the PDF specification and PAdES (PDF Advanced
//! Electronic Signatures) standards.
//!
//! ## Features
//!
//! - **Signature Creation**: Sign PDFs with X.509 certificates
//! - **Signature Verification**: Verify existing PDF signatures
//! - **Certificate Handling**: Parse and validate X.509 certificate chains
//! - **ByteRange Calculation**: Proper handling of PDF byte ranges for signing
//!
//! ## Signature Types Supported
//!
//! - PKCS#7 detached signatures (adbe.pkcs7.detached)
//! - PKCS#7 SHA-1 signatures (adbe.pkcs7.sha1)
//! - PAdES signatures (ETSI.CAdES.detached)
//!
//! ## Example
//!
//! ```ignore
//! use pdf_oxide::api::Pdf;
//! use pdf_oxide::signatures::{SigningCredentials, SignOptions};
//!
//! let mut pdf = Pdf::open("document.pdf")?;
//!
//! // Load signing credentials
//! let credentials = SigningCredentials::from_pkcs12("cert.p12", "password")?;
//!
//! // Sign the document
//! pdf.sign(&credentials, SignOptions::default())?;
//! pdf.save("signed_document.pdf")?;
//! ```
//!
//! ## PDF Specification Reference
//!
//! - ISO 32000-1:2008 Section 12.8 - Digital Signatures
//! - ISO 32000-2:2020 Section 12.8 - Digital Signatures
//! - ETSI TS 102 778 - PAdES
//!
//! Requires the `signatures` feature to be enabled.
pub use ByteRangeCalculator;
pub use PdfSigner;
pub use ;
pub use SignatureVerifier;