Sign with NDigitSign without Smart Card

12/30/2014 9:48:51 AM
Gravatar
Total Posts 4

Sign with NDigitSign without Smart Card

Hello,

I'm developing a class library for Signing PDF documents. In my interface i'm getting only two parameters. These are:

byte[] signPDF(X509Certificate2 signingCertificate, byte[] PDFContent);

In my class library i will get signing certificate so i don't need to read from smart card anything. When i didn't provide dll location to DigitalSigner it gives me null reference exception. 

As a result, I have one certificate and byte array of pdf file. How can I sign that pdf file ?

 

Thank you.

12/30/2014 10:05:49 AM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: Sign with NDigitSign without Smart Card

NDigitSign works with any smart card, token or HSM compliant with PKCS#11 specifications.

Digital Signature requires the private key the must be stored in some device (even on the HD). The certificate alone is not enough to make a digital signature. 

To sign a pdf you need  the private key and the related certificate.

I don't understand what you are trying to do.
12/30/2014 10:18:59 AM
Gravatar
Total Posts 4

Re: Sign with NDigitSign without Smart Card

Thanks for your reply,
Before NCryptoki I was using iText for signing PDF files and I was sending related certificate and pdf bytes. As you said before, I have private key and related certificate. In other words, I don't want to use NCryptoki for getting private key and certificate from Smart card, I only want to sign PDF files with private key and certificate. Is it possible ? 

Note: I'm beginner in this area. I think, I want PKCS#7 signing.

 

Thank you. 

12/30/2014 10:32:59 AM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: Sign with NDigitSign without Smart Card

NDigitSign uses the private key and certificate stored in the smart card, token or HSM by PKCS#11 interface.

Why you need NDigitSign to sign document if you don't have a smart card?

if you have private key and certificate in a file you don't need any third party library.

12/30/2014 12:51:38 PM
Gravatar
Total Posts 4

Re: Sign with NDigitSign without Smart Card

Thanks for reply, 

One more question, How can i use PKCS#7 with NDigitsign ? Do you have any example ? Because i didn't find anything.

 

Thanks...

12/30/2014 2:12:02 PM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: Sign with NDigitSign without Smart Card

In NDigitSign zip package available for download there are some samples that generate PKCS#7 signed file

12/30/2014 2:43:33 PM
Gravatar
Total Posts 4

Re: Sign with NDigitSign without Smart Card

Could you give me exact location in zip file ? I didn't find anything :(

12/30/2014 3:44:09 PM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: Sign with NDigitSign without Smart Card

A full comprehensive example is in FullTestDigitSign