简体   繁体   English

LTV 在 PDF 中启用签名

[英]LTV enabling signatures in PDF

As I understand there are two ways doing this by据我了解,有两种方法可以做到这一点

  • adding DSS dictionary添加 DSS 字典
  • embedding CRLs or OCSP responses in the signature at signing time在签名时将 CRL 或 OCSP 响应嵌入签名中

The DSS way seems to work and Adobe recognizes the signature as LTV enabled. DSS 方式似乎有效,并且 Adobe 将签名识别为启用 LTV。 The second way would fit much more into our application so I still try to get it to work.第二种方式更适合我们的应用程序,所以我仍然尝试让它工作。 I'm having issues adding the OCSP responses to the signature so I only try to add the certificates and the CRLs.我在将 OCSP 响应添加到签名时遇到问题,因此我只尝试添加证书和 CRL。 Correct me if I'm wrong but as I understand, either the CRLs or the OCSP responses should be added to the signature.如果我错了,请纠正我,但据我所知,应该将 CRL 或 OCSP 响应添加到签名中。 There is no need for both?两者都不需要吗? I collect the signing certificate and its root certificate, also the TSA certificate and its root certificate.我收集签名证书及其根证书,以及 TSA 证书及其根证书。 After that, I fetch all the CRLs.之后,我获取所有 CRL。 All this is added before the signing and the timestamp.所有这些都添加在签名和时间戳之前。 Adding only the certificates and the CRLs doesn't seem to work because Adobe doesn't recognize the signature as LTV enabled.仅添加证书和 CRL 似乎不起作用,因为 Adobe 不会将签名识别为启用 LTV。 I don't really understand what I'm doing wrong so any help is appreciated!我真的不明白我做错了什么,所以任何帮助表示赞赏!

Store crlStore = new JcaCRLStore(crls); 
gen.addCRLs(crlStore);

Store certStore = new JcaCertStore(certList); 
gen.addCertificates(certStore);

What you're doing wrong is putting the CRLs into the CMS signature container element generally used for CRLs.您做错的是将 CRL 放入通常用于 CRL 的 CMS 签名容器元素中。 In case of integrated PDF signatures, though, the situation is different;但是,在集成 PDF 签名的情况下,情况有所不同; here CRLs are expected in a special signed attribute instead.这里的 CRL 应该在一个特殊的签名属性中。

Have a look at ISO 32000-1 where this attribute already is specified:查看已指定此属性的 ISO 32000-1:

The PKCS#7 object should contain the following: PKCS#7 object 应包含以下内容:

... ...

  • Revocation information as an signed attribute (PDF 1.6): This attribute may include all the revocation information that is necessary to carry out revocation checks for the signer's certificate and its issuer certificates.作为签名属性的吊销信息(PDF 1.6):该属性可能包括对签名者证书及其颁发者证书执行吊销检查所需的所有吊销信息。 Since revocation information is a signed attribute, it must be obtained before the computation of the digital signature.由于撤销信息是签名属性,因此必须在计算数字签名之前获取。 This means that the software used by the signer must be able to construct the certification path and the associated revocation information.这意味着签名者使用的软件必须能够构建证书路径和相关的撤销信息。 If one of the elements cannot be obtained (eg no connection is possible), a signature with this attribute will not be possible.如果无法获得其中一个元素(例如无法连接),则无法使用此属性进行签名。

... ...

12.8.3.3.2 Revocation Information 12.8.3.3.2 撤销信息

The adbe Revocation Information attribute: adbe 吊销信息属性:

 adbe-revocationInfoArchival OBJECT IDENTIFIER::= { adbe(1.2.840.113583) acrobat(1) security(1) 8 }

The value of the revocation information attribute can include any of the following data types:撤销信息属性的值可以包括以下任何数据类型:

  • Certificate Revocation Lists (CRLs), described in RFC 3280 (see the Bibliography): CRLs are generally large and therefore should not be embedded in the PKCS#7 object. RFC 3280 中描述的证书撤销列表 (CRL)(参见参考书目):CRL 通常很大,因此不应嵌入 PKCS#7 object 中。
  • Online Certificate Status Protocol (OCSP) Responses, described in RFC 2560, X.509 Internet Public Key Infrastructure Online Certificate Status Protocol — OCSP (see the Bibliography): These are generally small and constant in size and should be the data type included in the PKCS#7 object.在线证书状态协议 (OCSP) 响应,在 RFC 2560、 X.509 互联网公钥基础设施在线证书状态协议 — OCSP (参见参考书目)中描述:这些通常很小且大小恒定,应该是包含在PKCS#7 object。
  • Custom revocation information: The format is not prescribed by this specification, other than that it be encoded as an OCTET STRING.自定义撤销信息:本规范未规定格式,除了将其编码为八位字节串。 The application should be able to determine the type of data contained within the OCTET STRING by looking at the associated OBJECT IDENTIFIER.应用程序应该能够通过查看相关的 OBJECT IDENTIFIER 来确定 OCTET STRING 中包含的数据类型。

adbe's Revocation Information attribute value has ASN.1 type RevocationInfoArchival: adbe 的 Revocation Information 属性值具有 ASN.1 类型 RevocationInfoArchival:

 RevocationInfoArchival::= SEQUENCE { crl [0] EXPLICIT SEQUENCE of CRLs, OPTIONAL ocsp [1] EXPLICIT SEQUENCE of OCSP Responses, OPTIONAL otherRevInfo [2] EXPLICIT SEQUENCE of OtherRevInfo, OPTIONAL } OtherRevInfo::= SEQUENCE { Type OBJECT IDENTIFIER Value OCTET STRING }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM