如何在没有数字签名的情况下添加时间戳 [英] how to add timestamp without Digital Signature

查看:565
本文介绍了如何在没有数字签名的情况下添加时间戳的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的PDF文档中添加时间戳(没有数字签名)。我该怎么做?

I want to add Time Stamp to my PDF document (without Digital Signature). How can I do this?

我可以使用Itext进行数字签名(我这里有TSAClient):

I can do it with Digital signature using Itext ( I have here TSAClient):

MakeSignature.signDetached(appearance, digest, signature, chain, null, null, tsa, 0, subfilter);

但如何在没有数字签名的情况下做同样的事情?使用Bouncy Castle或Itext或Pdfbox ......或者使用其他库..

but how to do similar thing without digital signature? using Bouncy Castle or Itext or Pdfbox... or with another library..

推荐答案

在iText中你正在寻找

In iText you are looking for

LtvTimestamp.timestamp(appearance, tsa, signatureName);

另请参阅JavaDoc文档:

Also cf. the JavaDoc documentation:

/**
 * Signs a document with a PAdES-LTV Timestamp. The document is closed at the end.
 * @param sap the signature appearance
 * @param tsa the timestamp generator
 * @param signatureName the signature name or null to have a name generated
 * automatically
 * @throws DocumentException 
 * @throws IOException 
 * @throws GeneralSecurityException
 */

您可能需要阅读添加文档安全存储(DSS)和文档级时间戳 / digitalsignaturesrel =nofollow> PDF文档的数字签名,供上下文使用。

You might want to read section 5.4.1 Adding a Document Security Store (DSS) and a Document-Level Timestamp in Digital Signatures for PDF documents for the use in context.

请注意,文档级时间戳记未被正确识别旧的PDF查看器,因为他们最近才进入PDF世界,即 PAdES-4

Be aware, document level time stamps are not properly recognized by old PDF viewers as they entered the PDF world only fairly recently, i.e. with PAdES-4.

这篇关于如何在没有数字签名的情况下添加时间戳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆