How to sign PDF file using NCryptotki.

4/11/2011 4:08:28 AM
Gravatar
Total Posts 1

How to sign PDF file using NCryptoki.

Hi all!

I need to sign PDF file using NCryptoki (NCryptoki used to get Certificate from USB token).

Thanks and best regards!

4/11/2011 12:08:04 PM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: How to sign PDF file using NCryptotki.

Hi,

You can use NCryptoki to sign a PDF but, explain here how to sign a PDF by using NCryptoki is a bit hard. There are a lot of things to explain, from the PKCS#7 format to the PDF signature format (PAdES).

You can avoid from all this technical stuffs by using my NDigitSign library. By NDigitSign you can sign a PDF file in the standard PDF signature format (PAdES).

You can download the latest version of NDigitSign from the download section.

In the zip file you can find also an example on how to sign a pdf.

If you need help don't hesitate to write me (see in Contacts)

Regards,

Ugo Chirico

10/19/2012 12:48:38 PM
Gravatar
Total Posts 3

Re: How to sign PDF file using NCryptotki.

hi,

I have the same problem as mouse. and I tried to use the example from NDigitSign but when I run the program I received an error :

Destination array was not long enough. Check destIndex and length, and the array's lower bounds.

The error rise at this method call :

 

dsign.SignPDFFile(@"c:\tosign.pdf", null, new SimpleCertificateSelector(), @"C:\signed_simple.pdf", "Test signature", "Ugo Chirico", "Naples", true, 10, 200, 150, 500, 200, false, tsaClient);

 

Could you give me an advice?

Thanks.

Robert

 

10/19/2012 4:03:50 PM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: How to sign PDF file using NCryptotki.

this error may happen in the current version when the certificate or the the timestamp is very large.

We are ready to publish a new version that solve it.

Check later in the download page.

 

10/19/2012 4:22:41 PM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: How to sign PDF file using NCryptotki.

NDigitSign updated. Download the latest version and let us know.

10/22/2012 8:05:11 AM
Gravatar
Total Posts 3

Re: How to sign PDF file using NCryptotki.

Thanks for help!

I downloaded new file but when I try to run TestNDigiSign I receive : PC/SC error: -2146434967.

The exception rise when this method is called : string cryptokiPath = DigitalSigner.GetMatchingCryptokiPath();
 

Regards,

Robert

10/22/2012 10:25:47 AM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: How to sign PDF file using NCryptotki.

The error you got is 0x80100069 and it means SCARD_W_REMOVED_CARD.

You called that method without any smart card inserted in the reader.

10/22/2012 10:33:20 AM
Gravatar
Total Posts 3

Re: How to sign PDF file using NCryptotki.

Hi and thanks again,

The smart card is inserted and I was able to read data from it with TestNCryptoki project.

Could be license problem? I let unchanged those values :

// Sets license info
DigitalSigner.Licensee = "licensee";
DigitalSigner.ProductKey = "yourproductkey";

 

 

Regards,

Robert

10/24/2012 2:38:28 PM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: How to sign PDF file using NCryptotki.

Maybe you have more than one reader? And the card is inserted in the other reader?