Digital Signatures

C# + VB.Net: Digital Signatures Digital Signatures
using IronPdf;

//The quickest way to cryptographically sign an existing PDF a digital certificate
new IronPdf.PdfSignature("Iron.p12", "123456").SignPdfFile("any.pdf");
// All done in 1 line of code!



//Advanced example for more control

// Step 1. Create a PDF
IronPdf.HtmlToPdf Renderer = new IronPdf.HtmlToPdf();
PdfDocument doc = Renderer.RenderHtmlAsPdf("<h1>Testing 2048 bit digital security</h1>");

// Step 2. Create a Signature.
// You may create a .pfx or .p12 PDF signing certificate using Adobe Acrobat Reader. 
// Read: https://helpx.adobe.com/acrobat/using/digital-ids.html
var signature = new IronPdf.PdfSignature("Iron.pfx", "123456");

// Step 3. Optional signing options and a handwritten signature graphic
signature.SigningContact = "support@ironsoftware.com";
signature.SigningLocation = "Chicago, USA";
signature.SigningReason = "To show how to sign a PDF";
signature.LoadSignatureImageFromFile("handwriting.png");

//Step 4. Sign the PDF with the PdfSignature. Multiple signing certificates may be used
doc.SignPdfWithDigitalSignature(signature);

//Step 4. The PDF is not signed until saved to file, steam or byte array.
doc.SaveAs("signed.pdf");
Imports IronPdf

'The quickest way to cryptographically sign an existing PDF a digital certificate
Call (New IronPdf.PdfSignature("Iron.p12", "123456")).SignPdfFile("any.pdf")
' All done in 1 line of code!



'Advanced example for more control

' Step 1. Create a PDF
Dim Renderer As New IronPdf.HtmlToPdf()
Dim doc As PdfDocument = Renderer.RenderHtmlAsPdf("<h1>Testing 2048 bit digital security</h1>")

' Step 2. Create a Signature.
' You may create a .pfx or .p12 PDF signing certificate using Adobe Acrobat Reader. 
' Read: https://helpx.adobe.com/acrobat/using/digital-ids.html
Dim signature = New IronPdf.PdfSignature("Iron.pfx", "123456")

' Step 3. Optional signing options and a handwritten signature graphic
signature.SigningContact = "support@ironsoftware.com"
signature.SigningLocation = "Chicago, USA"
signature.SigningReason = "To show how to sign a PDF"
signature.LoadSignatureImageFromFile("handwriting.png")

'Step 4. Sign the PDF with the PdfSignature. Multiple signing certificates may be used
doc.SignPdfWithDigitalSignature(signature)

'Step 4. The PDF is not signed until saved to file, steam or byte array.
doc.SaveAs("signed.pdf")

IronPDF has options to digitally sign new or existing PDF files using .pfx and .p12 X509Certificate2 digital certificates. (Not available in IronPDF .Net Core version at present) Once a PDF is signed, it can not be modified without the certificate being invalidated. This ensures fidelity. To generate a signing certificate for free using Adobe Reader, please read https://helpx.adobe.com/acrobat/using/digital-ids.html In addition to cryptographic signing, a hand written signature image or company stamp image may also be used to sign using IronPDF.