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? 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/
