0

我通过使用基于 java 的客户端获得了 TimeStampToken (RFC3161)。
我需要将 TSTInfo 中包含的所有信息存储在数据库、MySql 或 Oracle 中。是否有任何特定的格式来存储它?

4

2 回答 2

1

这种事情没有指定的格式1 。

但一些明显的替代方案浮现在脑海中:

  • 将 DER 编码的表单存储为 BLOB。

  • 采用 DER 编码形式,对其进行 base-64 编码并将其存储在 CHAR(n) 列中。

  • 创建一个包含列的表来表示TSSInfo结构的每个字段......假设您已经在解码它。

  • 使用 Java 序列化协议、XML、JSON 等对 Java 对象表示进行序列化。

  • 等等。


1 - 实际上,根据Wikipedia,有一种 ASN.1 编码,称为 XER,使用 XML 表示。

于 2015-02-27T11:04:55.123 回答
0

请注意,如果您只存储 TSTInfo,则会丢失签名,这是拥有 RFC3161 令牌的全部意义所在。没有签名的 TSTInfo 证明不了!

为了保留其证据属性,您确实应该存储整个时间戳记令牌(它被定义为包装 TSTInfo 的签名 CMS ContentInfo)。

就使用什么格式而言,RFC3161 规范(https://www.rfc-editor.org/rfc/rfc3161)的第 3.2 章可能会有所帮助(但这只是一个建议):

3. Transports

   There is no mandatory transport mechanism for TSA messages in this
   document.  The mechanisms described below are optional; additional
   optional mechanisms may be defined in the future.

[...]

3.2. File Based Protocol

   A file containing a time-stamp message MUST contain only the DER
   encoding of one TSA message, i.e., there MUST be no extraneous header
   or trailer information in the file.  Such files can be used to
   transport time stamp messages using for example, FTP.

因此,我会将 DER 编码的 CMS ContentInfo(不是 TSTInfo)存储为 BLOB

于 2021-02-22T16:33:17.463 回答