-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Leonard Rosenthol wrote: > I opened this PDF up in Acrobat 8.1 and it says that the document > hasn't been modified since it was signed, but the signature's > validity is unknown - which is correct since I don't have this sig in > my keystore. > > What am I missing?
Whether the signature is added as trusted or not, I get the same 4000 error code (Unrecognized Pdf Content) in the document integrity tab the original poster mentioned and this does not involve the timestamp code which is not yet part of the official iText library, but just adding a signature to a basic document. I thought that this could help figure out where the 4000 error code was coming from... I don't know if this error is "normal" or whether the signing code contains some code that is not completely following the Pdf reference. BTW, that was tested with Acrobat Reader 8.1.1 on Linux. Xavier > Leonard > > On Sep 30, 2007, at 1:30 PM, Xavier Le Vourch wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> Hi, >> >> I've got the same problem with the timestamping code but in fact, >> while >> trying to get a small example together, I've found that the same error >> occurs also with just the signing part. >> >> The signing code is based on the doc to sign doc at: >> >> http://itextpdf.sourceforge.net/howtosign.html#howtosign >> >> >> The two pdf files are attached. >> >> The Java code consists of: >> >> ========= >> com.lowagie.text.Document.compress = false; >> KeyStore ks = KeyStore.getInstance("pkcs12"); >> ks.load(new FileInputStream(KEYSTORE), PASSWORD.toCharArray()); >> String alias = (String)ks.aliases().nextElement(); >> PrivateKey key = (PrivateKey)ks.getKey(alias, PASSWORD.toCharArray()); >> Certificate[] chain = ks.getCertificateChain(alias); >> PdfReader reader = new PdfReader(IN); >> FileOutputStream fout = new FileOutputStream(OUT); >> PdfStamper stp = PdfStamper.createSignature(reader, fout, '\0'); >> PdfSignatureAppearance sap = stp.getSignatureAppearance(); >> sap.setCrypto(key, chain, null, PdfSignatureAppearance.WINCER_SIGNED); >> sap.setReason(REASON); >> sap.setLocation(LOCATION); >> // comment next line to have an invisible signature >> sap.setVisibleSignature(new Rectangle(100, 100, 200, 200), 1, null); >> stp.close(); >> ========= >> >> > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > iText-questions mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/itext-questions > Buy the iText book: http://itext.ugent.be/itext-in-action/ - -- Xavier Le Vourch Brittany Software, Inc. <[EMAIL PROTECTED]> PGP Key: http://brittanysoftware.com/gpg_key.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHAR6+A3JYBYlsWUcRAnB4AJ42cd2j66iJ0wSuTMJTKMn4C8evZACfeqlp lZakeWgkoAYKtQd+lFiExTQ= =os4v -----END PGP SIGNATURE----- ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
