【发布时间】:2012-05-10 14:24:50
【问题描述】:
我正在尝试使用iText Java。 当您运行示例“how to sign”时,会出现以下错误:
Caused by: java.lang.ClassNotFoundException: org.bouncycastle.tsp.TimeStampTokenInfo
根据"Getting Started with iText - How to sign a PDF using iText",我必须使用BouncyCastle。
我从BouncyCastle download page.下载了文件:bcprov-jdk15on-147.jar
并添加到项目中:Java Build Path/Libraries/Add External JARs...
我添加了以下行:
Security.addProvider(new BouncyCastleProvider());
当您运行该示例时,会发生同样的错误。
于是我下载了另一个文件:bcpkix-jdk15on-147.jar,标题为“PKIX/CMS/EAC/PKCS/OCSP/TSP/OPENSSL”
并添加到项目中:Java Build Path/Libraries/Add External JARs...
现在我有两个罐子了。
当您运行该示例时,会出现以下错误:
Caused by: java.lang.ClassNotFoundException: org.bouncycastle.asn1.DEREncodable
我尝试下载文件“bcprov-ext-jdk15on-147.jar”但没有解决问题。
我在 Windows 7 64 位上使用 iText 5.2.1 和 eclipse。
【问题讨论】:
标签: java exception cryptography itext bouncycastle