Create PAdES B-LT and B-LTA signatures in C#
PDF Advanced Electronic Signatures (PAdES) baseline levels define how much validation evidence is embedded in a signed PDF. B-LT embeds long-term validation material. B-LTA adds a document timestamp that protects that material.
Use PAdES B-LT or B-LTA for archival signing workflows where recipients validate signatures after certificates expire or revocation systems change.
This guide shows how to:
- Configure PAdES B-LT signing
- Configure PAdES B-LTA signing
- Save separate outputs for both baseline levels
PAdES B-LT and B-LTA require timestamp configuration and network access to revocation endpoints. B-LTA also appends a document timestamp after the validation material is embedded.
Prepare the project
Register the SDK license before running signing operations. For setup details, refer to the getting started with .NET SDK guide.
using System;using GdPicture14;
void CheckStatus(GdPictureStatus status, string operation){ if (status != GdPictureStatus.OK) { throw new InvalidOperationException($"{operation} failed. Status: {status}"); }}
LicenseManager license = new LicenseManager();license.RegisterKEY(""); // Set your license keyCreate a PAdES B-LT signature
Load the PDF, configure the certificate and timestamp authority, select PAdESBaselineLT, and apply the signature.
using GdPicturePDF bLtPdf = new GdPicturePDF();
CheckStatus(bLtPdf.LoadFromFile(@"input.pdf", false), "LoadFromFile");CheckStatus(bLtPdf.SetSignatureCertificateFromP12(@"certificate.pfx", "Nutrient answers all your document needs"), "SetSignatureCertificateFromP12");CheckStatus(bLtPdf.SetSignatureInfo("Nutrient", "PAdES B-LT signature", "Toulouse", "sales@nutrient.io"), "SetSignatureInfo");CheckStatus(bLtPdf.SetSignatureTimestampInfo("http://timestamp.digicert.com", "", ""), "SetSignatureTimestampInfo");CheckStatus(bLtPdf.SetSignatureHash(PdfSignatureHash.SHA256), "SetSignatureHash");CheckStatus(bLtPdf.SetSignaturePAdESLevel(PdfSignaturePAdESLevel.PAdESBaselineLT), "SetSignaturePAdESLevel");CheckStatus(bLtPdf.ApplySignature(@"signed-b-lt.pdf", PdfSignatureMode.PdfSignatureModeAdobeCADES, true), "ApplySignature");PAdESBaselineLT creates a signature with embedded validation material, such as certificates and revocation information.
Create a PAdES B-LTA signature
Repeat the signing setup and select PAdESBaselineLTA for an archival timestamp over the validation material.
using GdPicturePDF bLtaPdf = new GdPicturePDF();
CheckStatus(bLtaPdf.LoadFromFile(@"input.pdf", false), "LoadFromFile");CheckStatus(bLtaPdf.SetSignatureCertificateFromP12(@"certificate.pfx", "Nutrient answers all your document needs"), "SetSignatureCertificateFromP12");CheckStatus(bLtaPdf.SetSignatureInfo("Nutrient", "PAdES B-LTA signature", "Toulouse", "sales@nutrient.io"), "SetSignatureInfo");CheckStatus(bLtaPdf.SetSignatureTimestampInfo("http://timestamp.digicert.com", "", ""), "SetSignatureTimestampInfo");CheckStatus(bLtaPdf.SetSignatureHash(PdfSignatureHash.SHA256), "SetSignatureHash");CheckStatus(bLtaPdf.SetSignaturePAdESLevel(PdfSignaturePAdESLevel.PAdESBaselineLTA), "SetSignaturePAdESLevel");CheckStatus(bLtaPdf.ApplySignature(@"signed-b-lta.pdf", PdfSignatureMode.PdfSignatureModeAdobeCADES, true), "ApplySignature");PAdESBaselineLTA embeds validation material and appends a document timestamp that protects the resulting evidence.
Error handling
Check every GdPictureStatus value. Failures usually come from certificate chain issues, missing revocation endpoints, blocked OCSP or CRL access, or TSA connection problems.
Conclusion
This workflow creates PAdES B-LT and B-LTA signed PDFs for long-term and archival validation scenarios.