----- Original Message ----- From: "Carl H. Sayres" <[EMAIL PROTECTED]> To: <itext-questions@lists.sourceforge.net> Sent: Sunday, June 10, 2007 1:06 PM Subject: Re: [iText-questions] problems signing PDFs using a Verisigncertificate
Thanks Paulo! I changed VERISIGN_SIGNED to WINCER_SIGNED. That removed the plug-in message. Acrobat didn't recognize the Verisign root certificate until I changed the security settings to use all Windows root certificates. Does that jive with your experience? You must tell Acrobat who do you trust. I still can't get the signature graphic to display. Are there any rules for the image format, size, or color depth? No matter what I try, I don't see an image. It will work with a taller rectangle. Your rectangle is too narrow. Paulo Thanks! Carl Paulo Soares wrote: > > > >> -----Original Message----- >> From: [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED] On >> Behalf Of Carl H. Sayres >> Sent: Friday, June 08, 2007 3:41 PM >> To: iText-questions@lists.sourceforge.net >> Subject: [iText-questions] problems signing PDFs using a >> Verisign certificate >> >> I'm having two problems signing PDFs using a Verisign >> certificate with >> iText 2.0.4. >> >> 1. I'm including an Image of the handwritten signature using >> setSignatureGraphic. The signed PDF that iText produces does not show >> the image, though. >> > > Works for me using your code. > > >> 2. When I open the signed document in Acrobat Reader 8, it >> tells me that >> "The validity of the document is UNKNOWN. The plug-in required is not >> available.". When I click on the signature field, it tells me >> that the >> Verisign.PPKVS plug-in cannot be found. I have searched on Verisign's >> web site with no luck in finding such a plug-in. >> >> > > Use PdfSignatureAppearance.WINCER_SIGNED. The verisign mode was for the > old Acrobat 5 plug-in and it's not needed anymore. > > Paulo > > > >> Any help with these two issues would be very appreciated. >> >> Carl >> >> ps. In case it helps. here is my code: >> >> KeyStore ks = KeyStore.getInstance("pkcs12"); >> ks.load(new >> FileInputStream("C:/tt/csayres.pfx"),password.toCharArray()); >> String alias = (String)ks.aliases().nextElement(); >> PrivateKey key = (PrivateKey)ks.getKey(alias,password.toCharArray()); >> java.security.cert.Certificate[] chain = >> ks.getCertificateChain(alias); >> >> PdfReader pdfReader = new PdfReader(new >> FileInputStream("C:/tt/in.pdf")); >> FileOutputStream fos = new FileOutputStream("C:/tt/out.pdf"); >> PdfStamper stamper = PdfStamper.createSignature(pdfReader,fos,'\0'); >> PdfSignatureAppearance appearance = stamper.getSignatureAppearance(); >> >> Image img = Image.getInstance("C:/tt/csayres.png"); >> appearance.setRender(PdfSignatureAppearance.SignatureRenderGra >> phicAndDescription); >> appearance.setSignatureGraphic(img); >> appearance.setAcro6Layers(true); >> >> appearance.setVisibleSignature(new >> Rectangle(97.51f,234.24f,378.38f,253.41f),4,null); >> appearance.setCertificationLevel(PdfSignatureAppearance.CERTIF >> IED_NO_CHANGES_ALLOWED); >> appearance.setCrypto(key,chain,null,PdfSignatureAppearance.VER >> ISIGN_SIGNED); >> stamper.close(); ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/