Var externalSignature = new PrivateKeySignature(privateKey, "SHA-256") Var privateKey = DotNetUtilities.GetKeyPair(certificate.PrivateKey).Private private static void SignPdfWithLocalCertificate() The below code signs the Hello World.pdf using the certificate from the local store and saves that as Local Key.pdf. The PrivateKeySignature is an implementation of IExteralSignature that can be used to sign the PDF when the private key is available. Make sure that the certificate is installed with the Exportable option as shown below. ![]() ![]() You can load the certificate as an X509Certificate from the local certificate store using the thumbprint. When the certificate (along with the private key) is available locally, signing the PDF is straightforward. The below image shows the elements that composes a digital signature on the left and actual contents on the right. iText is available as a Nuget package library. We will be using the iText library to sign the PDF. ![]() Signing a PDF has various aspects to it which are covered in depth in the white paper - Digital Signatures for PDF Documents. In this post, we will explore how to sign a PDF using a certificate in Azure Key Vault. ![]() How to sign a PDF using Azure Key Vault? - This is one of the questions that I often get regarding Azure Key Vault.
0 Comments
Leave a Reply. |