|
Rank: Newbie Groups: Member
Joined: 4/21/2016 Posts: 3
|
Hello all!
I am looking into a solution for my company for pdf signing. I have tried to use EO, but I keep running into issues.
here is my code:
var cert = new X509Certificate2(@"C:\cert.pfx", "password"); var s = new PdfSigner(cert); s.Sign(@"C:\test.pdf");
and the error:
An exception of type 'System.Security.Cryptography.CryptographicException' occurred in mscorlib.dll but was not handled in user code Additional information: Key not valid for use in specified state.
I have tried a few other libraries and it seems to work, but I just wanted to see how this one stacked up against EO.
thanks!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi, Have you tried this constructor of PdfSigner yet? http://www.essentialobjects.com/doc/eo.pdf.pdfsignerconstructor3.aspxHere you would pass your certificate file name ans password directly to the PdfSigner class instead through a X509Certificate2 object. Please let us know if this works for you. Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 4/21/2016 Posts: 3
|
Yeah, I have tried both constructors. Both give the same error.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi, Can you try a self signed test certificate and see if it works? If that still does not work, please try to isolate the problem into a test project and send the test project to us. See here for more information on how to send test project to us: http://www.essentialobjects.com/forum/topics3_Support.aspxOnce we have that we will investigate further. Thanks!
|
|