Hi Paulo,
I've been working some day on an old (but still actual) Itext problem.
I need to "sign in two steps": first generate the hash, sign the hash on
another machine, and some time later insert the hash back into the pdf
document (using the external signature). I've found 5 or 6 posts in past
years, but i noticed it's still an open issue. Here is a detailed
description of what i wanted to do.

http://article.gmane.org/gmane.comp.java.lib.itext.general/28683
http://article.gmane.org/gmane.comp.java.lib.itext.general/32679

PdfSignatureAppearance.getRangeStream() doesn't return the same value across
multiple invocation. After playing around for a (long) while with
PdfStamperImp i've got the work done.

   1. HashMap(s) in PdfWriter are ordered according to the hash of the
   object. So when objects are serialized they're not always serialized in the
   same order. I changed the implementation to LinkedHashMap of these fields:
        formXObjects = new LinkedHashMap(),  documentColors = new
   LinkedHashMap(), documentFonts = new LinkedHashMap(), documentProperties =
   new LinkedHashMap();
   2. In PdfStamperImp.close(HashMap moreInfo): fileID is random. I use a
   "less random" implementation (for instance the hash of the previous if
   present).
   3. In PdfStamperImp.close(HashMap moreInfo) there is a new PdfDate().
   this date should be supplied externally.

Code modifications are not a lot once you've found them. I'll be glad to
give you further details if you need. Do you want me to file a RFE on the
sourceforge Tracker? (to avoid loosing informations)
Bye!
Davide
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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

Reply via email to