Nguyễn Trường Sơn,
Sonnt wrote:
> I'd love to use itext.
> I want to sign my file in 3 phases:
> 1. Create the hash
> 2. Sign the hash
> 3. Integrate signature
>
> But when i verify my file, itext says that it was modified.
You have to make sure you work with the same PdfStamper when you calculate
the hash value and when you insert the signature.
Sonnt wrote:
> static void createDigest() throws KeyStoreException, IOException,
> NoSuchAlgorithmException, CertificateException, URISyntaxException,
> UnrecoverableKeyException, DocumentException{
> [...]
> PdfStamper stp = PdfStamper.createSignature(reader, null, '\0');
> PdfSignatureAppearance sap = stp.getSignatureAppearance();
>
> [...]
>
> static void putSignature() throws Exception{
> [...]
> PdfStamper stp = PdfStamper.createSignature(reader, fout, '\0');
> PdfSignatureAppearance sap = stp.getSignatureAppearance();
You call createSignature twice. The information associated with these
signatures are different and, thus, their hash values.
For more information on signing in multiple steps search the archives for
"deferred signing" and "signing" in general.
Regards, Michael.
--
View this message in context:
http://itext-general.2136553.n4.nabble.com/Sign-with-external-hash-tp3086546p3087743.html
Sent from the iText - General mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
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