Hi Salvo, we faced a similar problem of splitting signature calculation and actually signing of the hash. So from my first look at your approach I would guess the calculation of the hash is your problem. Do you hash the whole document ? If yes, that's not the hash intended for PDF signing. The hash must e processed on the byte range given by the newly created signature object in the PDF.
Greetings and good luck Andreas ----- Original Message ---- From: Salvo Rapisarda <[email protected]> To: [email protected] Sent: Sat, March 13, 2010 3:34:42 PM Subject: [iText-questions] Java applet for signing PDF documents Hi. My name is Salvo and i'm developing a Java Applet for signing documents with iText library. In first time, I follow the example in that page (http://itextpdf.sourceforge.net/howtosign.html) and it's all ok. I have generated a PDF with a valid signature. Now the problem is that i want to sign a PDF that is located in a web server with ASP.NET, without send entire PDF to client-side. For doing that I have developed a web page that contains in a hidden input field the data of SHA1 hash function (made with ASP.NET and encoded in Base64). Java applet take the input of this input field and calculate signature (with BouncyCastle CMS and using client PrivateKey) and return the output of signature in another input field(Base64 encoded). A postback of page is made with Javascript and the output of signature was encapsuled with iTextSharp inside the PDF at server-side. All it's done without problem, but when I open signed version of PDF with Acrobat Reader the sign is not valid with reason: the document was modified after the signing. So the question is: I have made some mistake in my code or it's not possible to do a "asynchronous" signature process? Thanks. Salvo. ------------------------------------------------------------------------------ Download IntelĀ® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/ ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
