> -----Original Message-----
> From:
itext-questions-bounces@...
> [mailto:
itext-questions-bounces@...] On
> Behalf Of linkjaya
> Sent: Monday, July 16, 2007 1:05 PM
> To:
itext-questions@...
> Subject: Re: [iText-questions] Problem while digitally
> sighning pdf using IText.
>
> Thanks for your prompt reply. I created self signed digital
> id in two differnent ways First by using command line keytool
> -genkey -keyalg RSA -alias jaya -keypass matrix -keystore
> keystore.ks when i use this key i got following exception
> java.io.IOException: DerInputStream.getLength():
> lengthTag=109, too big. it also fails sighing in acrobat
> professional. Second by using tool given by acrobat
> professional. when i use this key following key Exception in
> thread "main" java.lang.NoClassDefFoundError:
> org/bouncycastle/asn1/DEREncodable i have downloaded latest
> version of itext from svn and compiled it. Here is the code
> that i used to sign the PDF. ks =
> KeyStore.getInstance("pkcs12"); ks.load(new
> FileInputStream("jaya.pfx"), "matrix321".toCharArray());
> String alias = (String) ks.aliases().nextElement();
> PrivateKey key = (PrivateKey) ks.getKey(alias,
> "matrix321".toCharArray()); Certificate[] chain =
> ks.getCertificateChain(alias); PdfReader reader = new
> PdfReader("signature.pdf"); FileOutputStream fout = new
> FileOutputStream("signed.pdf"); PdfStamper stp =
> PdfStamper.createSignature(reader, fout, '\0');
> PdfSignatureAppearance sap = stp.getSignatureAppearance();
> sap.setCrypto(key, chain, null,
> PdfSignatureAppearance.WINCER_SIGNED); sap.setReason("I'm the
> author"); sap.setLocation("Kathmandu"); // comment next line
> to have an invisible signature sap.setVisibleSignature(new
> Rectangle(100, 100, 200, 200), 1, null); stp.close(); Please
> help me. where did i make mistake?? Regards Jaya N Pasachhe
>
> Paulo Soares wrote:
> You'll be stuck forever if you don't provide more
> details. Where did you get the signature file from? Does it
> also fail if signing in Acrobat? What iText version are you
> using? What particular code are you using from
>
http://itextpdf.sourceforge.net/howtosign.html? Paulo >
> -----Original Message----- > From:
>
itext-questions-bounces@... >
> [mailto:
itext-questions-bounces@...] On >
> Behalf Of linkjaya > Sent: Monday, July 16, 2007 9:58 AM >
> To:
itext-questions@... > Subject:
> [iText-questions] Problem while digitally sighning > pdf
> using IText. > > Hello all, I want to add a digital signature
> in pdf file > containing singature field using Itext. i did
> as given in >
http://itextpdf.sourceforge.net/howtosign.html.
> but i always > get following exception while loading the
> signature file. > java.io.IOException:
> DerInputStream.getLength(): > lengthTag=109, too big. can
> some one know, where is my > problem? I am stuck over here.
> Any help will be appreciated. > Regards Jaya N Pasachhe.