First of all, sorry for double post, second thanks for Andreas for all your help.
I found out where the 131 bytes come from, apparently its from the sig.getEncodedPKCS1() array. This array is the same as the signedHash array (128 bytes) but with 3 extra bytes ({4}{-127}{-128}), these bytes never change. Is this normal behaviour? I cant find the source of the problem, i believe its one of 3 things: - the generated digest (which i dont think its the problem because its a very simple process, though it creates a 20 byte array (not sure if its normal)) - the signed hash/digest (which i dont its the source of the problem either since it has 128 bytes and in the pdf it shows the correct certificate and algorithm used, and i was asked for the pin to digitally sign the document) - something im doing wrong with iText (which i have no idea what could be) Im also wondering if Paulo Soares (conterrâneo) ever worked with Cartão do cidadão (portuguese citizen's card) to sign a document using iText Regards, Pedro -- View this message in context: http://itext-general.2136553.n4.nabble.com/Another-invalid-signature-thread-tp3003710p3007105.html Sent from the iText - General mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net 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