【问题标题】:how can I add certificate in DSS如何在 DSS 中添加证书
【发布时间】:2013-07-19 09:54:02
【问题描述】:

我做过类似的事情。对吗?

我已经:

        PDDocumentCatalog catalog = template.getDocumentCatalog();
        COSDictionary catalogDictionary = catalog.getCOSDictionary();
        COSDictionary dssDictionary = new COSDictionary();
        COSArray certDSS = getCertificateCosArray(certChainList);
        dssDictionary.setItem(COSName.getPDFName("Cert"), certDSS);
        catalogDictionary.setItem(COSName.getPDFName("DSS"), dssDictionary);

    and code to fill:

    public static COSArray getCertificateCosArray( List<X509Certificate> certChainList) {
    COSArray certDSS = new COSArray();

    for (X509Certificate x509Certificate : certChainList) {
        PDStream certificateStream = new PDStream(new COSStream(new RandomAccessBuffer()));
        appendRawCommands(certificateStream.createOutputStream(), x509Certificate.getEncoded());
        PDObjectStream pd = new PDObjectStream(certificateStream.getStream());
        certDSS.add(pd);
    }
    return certDSS;
}

我想它已经完成了。这是正确的方法吗?你觉得呢?

【问题讨论】:

  • DSS 字典中证书的 PDF 密钥是 Certs,而不是 Cert。密钥 Cert 用于单个签名的 VRI 字典。
  • 写下该评论,作为答案,我会检查作为答案。

标签: pdf digital-signature pdfbox


【解决方案1】:

正如已经写的评论:

DSS 字典中证书的 PDF 密钥是 Certs,而不是 CertCert 密钥用于单个签名的 VRI 字典。

详细信息可在ETSI TS 102 778-4(又名 PAdES 第 4 部分)的附件 A.1 文档安全存储中找到。它也将出现在 ISO 32000-2 中。

【讨论】:

    猜你喜欢
    • 2020-07-21
    • 2021-07-29
    • 1970-01-01
    • 2011-08-03
    • 2016-10-25
    • 2022-06-15
    • 1970-01-01
    • 2015-08-17
    • 1970-01-01
    相关资源
    最近更新 更多