Aspose.PDF Question About PDFNET-37412

Hello,

I have two inquiries regarding Aspose.PDF for .NET. The following issue

“PDFNET-37412 - Signing PDF using the X509Certificate2 instead PFX file” was said to have been fixed with the release of version 19.7. However I cannot seem to find a way to successfully sign a PDF document directly using an instantiation of the X509Certificate2 class. The only way I have been able to sign PDFs thus far has been by creating a PKCS7 object using a .pfx or .p12 file. Is there a way to create a PKCS7 object using a X509Certificate2 object (which I would create by reading the windows certificate store)?

Additionally I have noticed on our QA servers that signing documents with certain certificates causes the application to write to the MachineKeys folder (typically located at C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys) multiple times, even if the certificate has already been installed and can be found in the certificate store. Is this expected behaviour? Are certain certificates known to cause this behaviour? This is also the reason for my first question as I would like to avoid having the application write to this folder entirely if possible.

Regards,
Alex

@ag2121

Thank you for contacting support.

Would you please visit Sign PDF Document From Smart Card and then share your kind feedback with us.

Hi Farhan,

Thank you for the response. I will try implementing this code but just to be clear - will this bypass writing to the MachineKeys folder?

Thanks,
Alex

@ag2121

If you still face any problem of additional folders then share a sample application containing SSCCE code and necessary resources so that we may try to reproduce and investigate further.