Hi.
I want to encrypt a document and then sign it. I use the code below.
// encription
//Instantiating PdfFileSecurity object
PdfFileSecurity fileSecurity = new PdfFileSecurity("test.pdf", "test_enc.pdf");
//Calling EncryptFile method to encrypt the PDF document
fileSecurity.EncryptFile("", "ownerpassword", PdfPrivilege.Copy | PdfPrivilege.Print, true);
// sign
Certificate certificate = new Aspose.Pdf.Kit.Certificate("qwe.pfx", "qwe");
PdfFileSignature pdfSign = new PdfFileSignature(certificate);
pdfSign.SignModel = Aspose.Pdf.Kit.PdfFileSignature.WindowsCertificate;
pdfSign.BindPdf("test_enc.pdf");
System.Drawing.Rectangle rect = new System.Drawing.Rectangle(100, 100, 200, 100);
pdfSign.Sign(1, "", "", "", false, rect);
pdfSign.CertificationLevel = PdfFileSignature.NotCertified;
pdfSign.Save("test_sign.pdf");
But result file has a signature only. The result file has not an encryption.
How can I use an encryption and signature together?