Hi,
I have the need to password protect and sign some PDF’s. I’ve managed to find some examples to password protect and digitally sign, but I’m unable to perform them together.
I have the following code to password protect
Dim document As New Aspose.Pdf.Document("Source.pdf")
document.Encrypt("user", "owner", 0, Aspose.Pdf.CryptoAlgorithm.AESx128)
document.Save("PasswordProtected.pdf")
and the following to sign
Dim pdfSign As Aspose.Pdf.Kit.PdfFileSignature = New Aspose.Pdf.Kit.PdfFileSignature(srcPDF, dstPDF)
Dim signature7 = New Aspose.Pdf.Kit.Pkcs7Signature("Metrofile")
signature7.Reason = "Pkcs7 Signature Example"
signature7.Date = Now
pdfSign.Sign(1, False, New System.Drawing.Rectangle(100, 400, 200, 500), signature7)
pdfSign.Save()
I need to know how to perform this preferably in one pass, or if I can't do it in one pass then how do I open a password protected pdf in the second code example?
Many thanks
Wayne