Note: This is a legacy project originally written in 2018. It uses older libraries, including a bundled LGPL copy of iTextSharp (v4.1.6) that is compatible with the code. The iTextSharp LGPL edition has since been superseded by iText 7+ under a different license. This repository is preserved as-is for reference and archival purposes.
A Windows desktop application for digitally signing, encrypting, and managing metadata of PDF documents. Built with .NET Framework and iTextSharp.
- Sign PDFs with PKCS#7 detached signatures using X.509 certificates
- Load certificates from the Windows Certificate Store or from
.pfx/.p12files - Visual signature placement — drag and resize the signature on a page preview
- Custom signature text, contact, reason, and location fields
- Optional signature image overlay
- Multi-signature support — add signatures without invalidating existing ones
- RFC 3161 timestamp authority support
- Authenticated TSA connections (login/password)
- Automatic OCSP response embedding when a full certificate chain is available
- Password-based PDF encryption (user and owner passwords)
- Granular permission control:
- Printing / Degraded printing
- Copy content
- Modify content / Modify annotations
- Fill in forms
- Document assembly
- Screen readers accessibility
- Read and write standard PDF metadata fields (Author, Title, Subject, Keywords, Creator, Producer)
- XMP metadata support
- Visual Studio 2017 or later
- .NET Framework 4.8 SDK
- Open
iSafePDF.slnin Visual Studio - Build the solution (Ctrl+Shift+B)
The solution contains three projects:
| Project | Description |
|---|---|
iSafePDF | Main WinForms application |
bccrypto | Bouncy Castle cryptography library |
itextsharp | iTextSharp LGPL PDF library (v4.1.6) |
- Document tab — Select an input PDF and an output path. If the PDF is password-protected, you'll be prompted for the password. Existing metadata is loaded automatically for editing.
- Signature tab — Click "Select Certificate" to choose a signing certificate. Configure the signature appearance, position, and optional TSA timestamping.
- Encryption tab — Optionally enable encryption with user/owner passwords and set document permissions.
- Click Process to generate the signed/encrypted PDF.
Form1 (Main UI)
|
|-- Cert Certificate & private key wrapper (Bouncy Castle PKCS#12)
|-- MetaData PDF metadata holder with XMP serialization
|-- PDFSignatureAP Signature appearance properties
|-- PDFEncryption Encryption config & permission flags
|-- PDFSigner Core signing engine (iTextSharp PdfStamper + PdfPKCS7)
|
|-- CertificateDialog Certificate selection (store + file browse)
|-- PwdDialog Password prompt for encrypted PDFs
|-- PickBox Visual drag/resize handles for signature placement
- iTextSharp LGPL 4.1.6 — PDF reading, writing, and signing
- Bouncy Castle C# — Cryptographic operations, PKCS#12 parsing, TSA client
This project is licensed under the GNU Lesser General Public License v2.1.
Alaa-eddine KADDOURI — @alaa-eddine