Certificate signing
Digitally sign a generated PDF
Create a PDF and apply a certificate-backed signature during the server-side save operation.
Signing pipelineProtect identity and integrity
The signature is part of the exported PDF and can be validated by compatible readers.
PKCS#12
InputServer document
CertificateDemo PFX
Private keyExportable
OutputSigned PDF
Production guidanceKeep private keys protected
The bundled certificate is for demonstration only. Production applications should use an appropriate certificate store or key-management service.
The generated file can be inspected in the viewer and downloaded for signature validation.
Ready to tryUse the controls above to interact with this demo.
What this demonstrates
Apply a certificate-backed PDF signature
A digital signature protects document integrity and identifies the certificate used during signing. Any later modification can invalidate the signature in a compatible PDF reader.
This server-side workflow is suitable for automated output such as invoices, reports, or archival documents where the signing certificate is managed by the application.
API used
SaveSettings.DigitalSignature
Key members
The PKCS#12 certificate must expose its private key. SaveSettings.DigitalSignature applies the certificate-backed signature during PDF export.
using var certificate = X509CertificateLoader.LoadPkcs12(
File.ReadAllBytes(certificatePath),
password,
X509KeyStorageFlags.MachineKeySet |
X509KeyStorageFlags.Exportable);
var settings = new SaveSettings
{
DigitalSignature = new DigitalSignature(certificate, null)
};
textControl.Save(out byte[] pdf, BinaryStreamType.AdobePDF, settings);
How it works
The controller loads the bundled PKCS#12 certificate with X509KeyStorageFlags.Exportable, assigns a DigitalSignature to SaveSettings, and exports a signed Adobe PDF.
NuGet packages
TXTextControl.TextControl.Core.SDK
34.0.4
Provides the core document model and server-side document processing APIs.
dotnet add package TXTextControl.TextControl.Core.SDK --version 34.0.4
Displays supported document and PDF formats in the browser.
dotnet add package TXTextControl.Web.DocumentViewer --version 34.2.0
Source files
See the implementation
The complete demo is encapsulated in Demos/Pdf/Security/DigitalSignatures.