Pular para o conteúdo principal

PAdES signatures

The PAdES standard sets the rules for signing PDF files. In the SDK, the @Lacuna.Pki.Pades.PadesSigner class is the central object that creates PDF signatures following the ETSI 102778-x specification.

Basic signature example​

The code below shows a basic PAdES signature, to introduce and exercise the concepts and properties of this signer.

// Instantiate the signer object, which creates the signature
var signer = new PadesSigner();

signer.SetSigningCertificate(signingCert); // the signer's certificate, with its private key
signer.SetPdfToSign(pdfBytes); // bytes or stream of the PDF document to sign
signer.SetPolicy(PadesPolicySpec.GetBasic()); // basic policy, with the Windows roots as TrustArbitrators
signer.ComputeSignature(); // creates the attributes and gets the signer's signature

byte[] signedPdf = signer.GetPadesSignature(); // returns the bytes of the signed PDF
View as Markdown