Hi,
I am having trouble digitally signing a pdf hash. This is the implementation
and the solution I have found, which is based on Bruno Lewagie's Digital
Signatures for PDF Documents. The idea is to sign the PDF hash to avoid
taking it to the client.
This is the solution I have come up with:
1. An Applet Java with which I instance a token, get it, and then access it.
2. A servlet java I use to get the hash of the PDF I want to sign. I
calculate the hash with the public key I got from the applet. After getting
this hash, I send it to the applet (client) to get it signed. 

The applet signs the resulting PDF hash and then returns it to the servlet
to be inserted in the resulting PDF and saved in a given directory. 
At first, it seemed to work out all right, but after completing the process
and opening the PDF with any reader, I get the following error: "Internal
cryptografic error. Error code: 0x2727". 

It is worth mentioning that when I creat a PDF and sign it only with the
applet, the signature is correctly validated.

Code: 
Applet that interacts with the token and invokes the servlet -> 
<http://itext.2136553.n4.nabble.com/file/n4661022/1.png> 

Servlet that after having received the public key of the certificate (sent
by the applet) reads a PDF and calculates its hash to return it to the
applet. 
<http://itext.2136553.n4.nabble.com/file/n4661022/2.png> 

After signing the PDF the servlet is invoked once again from the applet to
insert the signed hash in the resulting PDF --> 
<http://itext.2136553.n4.nabble.com/file/n4661022/3.png> 

These are the versions of the libraries I used:
itextpdf -> 5.5.6 
bcprov.jdk15on.1.54 
jdk1.7 







--
View this message in context: 
http://itext.2136553.n4.nabble.com/Problem-when-signing-PDF-hash-in-PDF-readers-Code-error-0x2727-tp4661022.html
Sent from the iText mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to