1
我想檢查給定的PDF文件簽名是否存在時間戳。 到目前爲止,我來到這個代碼:使用iText檢查時間戳2.1.7
RandomAccessFileOrArray random =
new RandomAccessFileOrArray(new File("temp.pdf").getAbsolutePath());
PdfReader reader = new PdfReader(random, null);
AcroFields af = reader.getAcroFields();
ArrayList<?> names = af.getSignatureNames();
//this are the signatures?
for (Object o : names){
AcroFields.Item item = (Item) af.getFields().get((String)o);
//this is the class for verifying the signature,
//how do I get it from the item?
PdfPKCS7 pdfPKCS7 = null; //XYZ ???
Calendar signingDate = pdfPKCS7.getTimeStampDate();
}
我顯然已取得了簽名,但我應該得到PdfPKCS7類驗證簽名。有誰知道我怎麼去那裏?
我以前有過這個解決方案,但它不會編譯。我下載了itext版本,發現af.verifySignature(name)起作用。這是我修改過的第三方版本。謝謝。 – mrcaramori 2013-03-06 14:12:40