I really appreciate your quick reply Michael. I will see how I can resolve
it with some mailing list archive for the preferred search.

Thanks a lot.
Faisal



On Tue, May 22, 2012 at 2:23 PM, mkl <[email protected]> wrote:

> Faisal,
>
> Faisal Maqsood wrote
> > I am digitally signing the PDF using smart card and I am successful in
> > doing so. [...] If I do the all 5 steps in one go, it works perfect.
> >
> > Problem comes when I *compute the hash again to use in step 3* because of
> > my business needs.
> > I checked that if I compute the hash again, the hash value changes.
> >
> > I assume that while computing hash, iText internally do the signing time
> > during hash and because of this the value changes.
>
> This problem has been discussed here many times. Search the mailing list
> archives for "deferred signing" to find a number of solutions. Which one of
> them suits you best, depends on your actual business needs.
>
> In a nutshell: Yes, each time you call createSignature and later preClose
> the associated signature appearance, you will get slightly different PDFs
> (which is completely correct: each time you start changing a PDF, the
> result
> must have an individual ID and individual modification and signing times).
> Thus, your choices are to
>
> * either keep the original PdfStamper and SignatureAppearance until you
> eventually get the signature bytes;
> * or store the PDF generated by the original PdfStamper and
> SignatureAppearance using some dummy signature bytes and later patch that
> file using the actual signature (if you are signing in append mode, storing
> the newly added revision and lateron concatenating the file parts
> suffices);
> * or patch iText to use IDs, modification dates, and signing dates (did I
> miss some variable item?) you provide externally.
>
> The latter option should be used a last resort only.
>
> Regards,   Michael
>
> --
> View this message in context:
> http://itext-general.2136553.n4.nabble.com/How-to-get-same-hash-again-tp4649641p4649651.html
> Sent from the iText - General mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> iText-questions mailing list
> [email protected]
> 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
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
iText-questions mailing list
[email protected]
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