Rafael,

Rafael Wampfler wrote:
> of course, here are the two documents. RSA working, DSA not

In Listing 12.19 (which was the one you started from) a placeholder byte[]
of 128 bytes is used for the RSA/1024 signature as that kind of signature
takes up exactly that much space. Accordingly a few more than 256 bytes (the
exact number of bytes required to hold a hex-digit encoded PKCS#1 object
holding a RSA/1024) are reserved in the PDF and are marked as the gap in the
PDF which is not to be hashed. Later on filled they are filled with the
actual signature.

Now in testsignDSA.pdf you reserve the same number of bytes, too, but your
signature is way smaller (the hex encoded PKCS#1 takes up less than 100
bytes). Thus, the gap in the PDF marked not to be hashed is way bigger than
your signature. Adobe Reader considers this to be suspicious as the gap
might contain PDF objects which could easily be manipulated without changing
the hash. Therefore, Adobe Reader rejects your signature.

You should reserve exactly the number of bytes you are going to use
eventually. Either reserve less bytes or eventually pad your signature with
0 to be long enough.

Adobe Acrobat actually talks about "SigDict /Contents illegal data". So
maybe there are additional problems with your very signature. As soon as
sizes match we can take the next step.

Regards,   Michael.


-- 
View this message in context: 
http://itext-general.2136553.n4.nabble.com/Digital-signature-with-DSA-key-tp3264088p3264203.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb
_______________________________________________
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

Reply via email to