我正在尝试‘完成ltv’,一个已经签名的pdf,我发现这段代码使用itext:
http://developers.itextpdf.com/question/how-enable-ltv-timestamp-signature
public void addLtv(String src, String dest, OcspClient ocsp, CrlClient crl, TSAClient tsa)
throws IOException, DocumentException, GeneralSecurityException {
PdfReader r = new PdfReader(src);
FileOutputStream fos = new FileOutputStream(dest);
PdfStamper stp = PdfStamper.createSignature(r, fos, '\0', null, true);
LtvVerification v = stp.getLtvVerification();
AcroFields fields = stp.getAcroFields();
List<String> names = fields.getSignatureNames();
String sigName = names.get(names.size() - 1);
PdfPKCS7 pkcs7 = fields.verifySignature(sigName);
if (pkcs7.isTsp()) {
v.addVerification(sigName, ocsp, crl,
LtvVerification.CertificateOption.SIGNING_CERTIFICATE,
LtvVerification.Level.OCSP_CRL,
LtvVerification.CertificateInclusion.NO);
}
else {
for (String name : names) {
v.addVerification(name, ocsp, crl,
LtvVerification.CertificateOption.WHOLE_CHAIN,
LtvVerification.Level.OCSP_CRL,
LtvVerification.CertificateInclusion.NO);
}
}
PdfSignatureAppearance sap = stp.getSignatureAppearance();
LtvTimestamp.timestamp(sap, tsa, null);
}我读到Adobe有一个“问题”,因为应用的时间戳不被认为是支持LTV的,并建议应用一个新的dss来解决这个问题。
我的问题:
- If yes... this is approved by ETSI? Can iText handle it? I noticed that addVerification adds info from signatures already included, but seems i can't add the required info with this method. There's another way to add 'free' verifications or addVerification let's me and i didn't notice?
- If no... Why? Then why i not need to timestamp again the new dss added?
如你所见..。我不是专家,我需要帮助。
非常感谢你的帮助!
发布于 2016-09-27 16:53:37
我的问题:
从技术上讲,您可以在应用相关的签名/时间戳之前添加任何与验证相关的信息。实际上,您甚至必须这样做,如果使用ol‘型ISO 32000-1签名,需要验证信息才能在签名的属性中。
这些信息是否被验证者所接受,取决于。
ETSI TS 102 778-4 V1.1.1说:
4.3验证过程 建议确认程序如下:
没有文档时间戳的文档的验证不属于本概要文件的范围.
如果验证器根据这些建议进行验证,它将不会接受您想要的验证信息,至少它不会识别用于验证的时间戳。
但是,由于这些只是建议,其他TS或EN文档可能会提出不同的建议,因此您感兴趣的验证人员可能会按照您的要求接受您的验证信息。
https://stackoverflow.com/questions/39711206
复制相似问题