|
Hi, i followed the code snippet provided in iText in Action book. and when i run the following code, i get a java.lang.NoSuchMethodError: org.bouncycastle.asn1.DERSequence.<init>(Lorg/bouncycastle/asn1/DEREncodableVector;)V exception
KeyStore ks = KeyStore.getInstance("pkcs12"); String alias = "aprivatekey"; FileInputStream fis = new FileInputStream(keystoreFilePath); BufferedInputStream bufin = new BufferedInputStream(fis); ks.load(bufin, password.toCharArray()); PrivateKey pk = (PrivateKey)ks.getKey(alias, password.toCharArray()); Certificate[] chain = ks.getCertificateChain(alias); PdfReader reader = new PdfReader(filename1); PdfStamper stamper = PdfStamper.createSignature(reader, new FileOutputStream(filename2), '\0', null, true); PdfSignatureAppearance appearance = stamper.getSignatureAppearance(); appearance.setVisibleSignature("mySig"); appearance.setReason("It's something"); appearance.setLocation("MD"); appearance.setCrypto(pk, chain, null, PdfSignatureAppearance.WINCER_SIGNED); appearance.setCertificationLevel(PdfSignatureAppearance.CERTIFIED_NO_CHANGES_ALLOWED); stamper.close(); reader.close(); The code throws the exception when calling stamper.close(); Another post talks about bouncycastle version. I tried using bouncycastle jar version 1.46 and 1.38. Same exception. What would be the exact version of bouncycastle that will support iText? Why is the exception being thrown? Thanks in advance. |
|
Hello,
I remember coming across a similar error and I use 1.43 to avoid it.
2011/5/3 vinothkp <[hidden email]> Hi, i followed the code snippet provided in iText in Action book. and when i ------------------------------------------------------------------------------ WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd _______________________________________________ iText-questions mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/itext-questions iText(R) is a registered trademark of 1T3XT BVBA. 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 |
|
Cosmin, I tried searching for 1.43, but could not find it. google, bouncy website, its not there.
http://www.bouncycastle.org/latest_releases.html if you do have it, can you please provide that jar to me somehow? or point me to somewhere (like and archive) i can download it from. On Tue, May 3, 2011 at 1:13 PM, Cosmin Ciuraru [via iText - General] <[hidden email]> wrote: Hello, |
|
I remember that too.
I just had to replace the 6 in 146 from the current version with the 3. OK, one would argue for a checksum. ------------------------------------------------------------------------------ WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd _______________________________________________ iText-questions mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/itext-questions iText(R) is a registered trademark of 1T3XT BVBA. 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 |
|
Cosmin, that works thanks.
but i downloaded this file http://grepcode.com/snapshot/repo1.maven.org/maven2/org.bouncycastle/bcprov-jdk15/1.43 On Tue, May 3, 2011 at 1:33 PM, Cosmin Ciuraru [via iText - General] <[hidden email]> wrote: I remember that too. |
|
On 3/05/2011 22:28, vinothkp wrote: Cosmin, that works thanks. ------------------------------------------------------------------------------ WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd _______________________________________________ iText-questions mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/itext-questions iText(R) is a registered trademark of 1T3XT BVBA. 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 |
| Powered by Nabble | Edit this page |
