Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Secure PDF Documents with Digital Signatures in ASP.NET Core Using Syncfusion® .NET PDF Library

A lightweight ASP.NET Core sample that demonstrates how to sign, secure, and validate PDF documents using the Syncfusion .NET PDF Library. The application allows users to apply digital signatures, encrypt PDF files, configure document permissions, and retrieve signature details from signed PDFs.

Pages

Page Route Description
Home / Landing page with links to both demo pages.
Sign & Secure /Signature/Sign Upload (or use the default) PDF, PFX, signature image, then sign + apply encryption/permissions and download.
Validate /Signature/Validate Upload (or use the default) signed PDF, view signer certificate and signature info.

Features

  • Visible signature image overlay on the last page
  • Invisible digital signature (PKCS#7 / CAdES, SHA-256)
  • AES-256 encryption with an open password
  • Disable printing / copying / editing
  • Flatten AcroForm fields
  • Read-back of signature + signer certificate details

Project structure

PdfDigitalSignatureAndSecurityDemo
├── Controllers
│   ├── HomeController.cs
│   └── SignatureController.cs
├── Models
│   ├── SignPdfViewModel.cs
│   └── ValidateSignatureViewModel.cs
├── Services
│   ├── PdfSecurityService.cs
│   └── PdfValidationService.cs
├── Views
│   ├── Home
│   │   └── Index.cshtml
│   ├── Signature
│   │   ├── Sign.cshtml
│   │   └── Validate.cshtml
│   └── Shared
│       └── _Layout.cshtml
├── wwwroot
│   └── SampleFiles
│       ├── Input.pdf
│       ├── SignedDocument.pdf
│       ├── Signature.png
│       └── Certificate.pfx
├── Properties
│   └── launchSettings.json
├── Program.cs
├── appsettings.json
└── PdfDigitalSignatureAndSecurityDemo.csproj

Run

cd PdfDigitalSignatureAndSecurityDemo
dotnet restore
dotnet run

Then open https://localhost:5001 (or http://localhost:5000).

Syncfusion license

Set your Syncfusion license key via:

  • Environment variable SYNCFUSION_LICENSE_KEY, or
  • appsettings.jsonSyncfusion:LicenseKey, or
  • The SyncfusionLicenseProvider.RegisterLicense(...) call in Program.cs.

A free community license is available at https://www.syncfusion.com/products/communitylicense.

Default sample files

File Default password (when none supplied in UI)
Certificate.pfx syncfusion

Replace the bundled Input.pdf, Signature.png, Certificate.pfx, and SignedDocument.pdf with your own files to try the demo end-to-end.

About

This repository contains examples demonstrating secure PDF signing and signature validation using the Syncfusion PDF Library. The samples showcase applying digital signatures, signing with certificates, validating signatures, verifying document integrity, and implementing secure PDF workflows across .NET applications.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages