We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Creating Digital Signature

Thread ID:





54008 Dec 27,2006 11:03 AM UTC Dec 28,2006 07:20 AM UTC WinForms 1
Tags: PDF
Asked On December 27, 2006 11:03 AM UTC

I install a PFX file into my Certificate Store then I check the option that enable strong private key protection.
After this, I'm prompted with the CryptoAPI Private Key Windows Form wich I set my security level to High.

Executing the following code, the CryptoAPI ask me to insert the password.

Dim pdfDoc As Syncfusion.Pdf.PDFDocument
Dim provider As IPDFCertificateStore
Dim cert As IPDFCertificate
Dim signInfo As IPDFDigitalSignature
Dim rect As RectangleF

pdfDoc = PDFDocument.Load(strFilePath)
provider = pdfDoc.Security.GetCertificateStore(StoreType.MY)
cert = provider.FindBySubject(strFullname)

rect = New RectangleF(0, 0, 594, 200)
signInfo = pdfDoc.Security.CreateDigitalSignature(pdfDoc.LastPage, rect, cert)

pdfDoc.Save("d:\teste_" & GetGUID() & ".pdf")

First question: If I press the cancel button the pdfDoc.Save(...) function generates a PDF with an invalid certificate.
How can I get this information programmaticaly?

Second question: If I insert the right password, and immediatly certificate different PDFs everything works fine, but is there any possiblity to prompt the password every time?

Note: I'm running the above code under a thread.

Thank's in advance!

Dhivya K [Syncfusion]
Replied On December 28, 2006 07:20 AM UTC

Hi Ricardo,

Thanks for your detailed explanation and code snippets.

I tested the issue as follows
->installed the certificate as you said[set private key with high level security option]
-> when I signed the document,I clicked the "cancel" button.
I received the output PDF signed with the certificate that I have mentioned in my code with verifcation error which is expected as we didn't provide the password[pressed cancel button].

1) Regarding your first question, Pdf has been signed by the certificate that you have mentioned but with verification error. You can find the details of the certificate that has been signed by viewing the signature properties. However, I am not clear about the question you have asked. Can you please ellobrate about which information you want to get programmatically?
Here is a sample PDF document generated.

2) Regarding your second question,

Can you please clarify me whether you are trying to sign multiple PDF documents with a single certificate using threads?
If so is the case,it prompts for the password for each thread.
Here is a sample for your reference:

Please let me know if my assumptions doen't meets your need. Also, Can you please provide me the Essential studio version your are using. This will help me investigating further on this issue.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon