forge/lib.rs
1//! # forge
2//!
3//! A Rust library and command-line tool for converting PFX/P12 certificate files to PEM format.
4//!
5//! ## Features
6//!
7//! - Convert PFX/P12 files to PEM format
8//! - Support for password-protected files
9//! - Extract certificate chains
10//! - Generate combined PEM files
11//! - Pure Rust implementation using OpenSSL bindings
12//!
13//! ## Usage as a Library
14//!
15//! ```rust,no_run
16//! use forge::openssl::{PfxParser, PemFormatter};
17//!
18//! // Parse a PFX file
19//! let parsed = PfxParser::parse_file("certificate.pfx", "password")?;
20//!
21//! // Convert to PEM format
22//! let private_key_pem = PemFormatter::private_key_to_pem(&parsed)?;
23//! let certificate_pem = PemFormatter::certificate_to_pem(&parsed)?;
24//! # Ok::<(), Box<dyn std::error::Error>>(())
25//! ```
26
27pub mod cli;
28pub mod converter;
29pub mod error;
30pub mod openssl;
31pub mod output;
32
33// Re-export commonly used types
34pub use error::ConversionError;
35pub use openssl::{ParsedPfx, PemFormatter, PfxParser};