Hi Scott,
Thanks for your feedback. Please check following code snippet, initially we have encrypt the document and later signed. Hopefully it will help you to accomplish the task.
Dim ms As New MemoryStream()
Dim document = New Document(myDir + "HelloWorld.pdf")
document.Encrypt("user",
"owner", 0, Aspose.Pdf.CryptoAlgorithm.AESx128)
document.Save(ms)
'create PdfFileSignature object and
bind input and output PDF files
Dim pdfSign As New PdfFileSignature()
pdfSign.BindPdf(New Document(ms, "owner"))
'create a rectangle for signature
location
Dim rect As New System.Drawing.Rectangle(100, 100,
200, 100)
'set signature appearance
pdfSign.SignatureAppearance = myDir + "Aspose.png"
'create any of the three signature
types
'PKCS1 signature = new
PKCS1("temp.pfx", "password"); // PKCS#1 or
Dim signature As New PKCS7(myDir + "temp.pfx", "password")
' PKCS#7 or
pdfSign.Sign(1, "Signature
Reason", "Contact", "Location", True, rect, _
signature)
'save output PDF file
pdfSign.Save(myDir + "DigitalSign_protected.pdf")
Please feel free to contact us for any further assistance.
Best Regards,