XadessignedProperties的哈希值不准确

发布于 2025-01-30 07:44:50 字数 2198 浏览 4 评论 0原文

I have an UBL XML file and need to hash sha256 for xadesSignedProperties and the part need to be hash is :

<xades:QualifyingProperties xmlns:xades="http://uri.etsi.org/01903/v1.3.2#" Target="signature">
                           <xades:SignedProperties Id="xadesSignedProperties">
                              <xades:SignedSignatureProperties>
                                 <xades:SigningTime>2021-02-25T12:57:51Z</xades:SigningTime>
                                 <xades:SigningCertificate>
                                    <xades:Cert>
                                       <xades:CertDigest>
                                          <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
                                          <ds:DigestValue>9ef6c0b90ae609868bb614772e1d5375464ed1a1793ded751feb1e3414980f7c</ds:DigestValue>
                                       </xades:CertDigest>
                                       <xades:IssuerSerial>
                                          <ds:X509IssuerName>CN=CommonName,O=GAZT,L=Katowice,ST=Silesia,C=PL</ds:X509IssuerName>
                                          <ds:X509SerialNumber>15007377309689649296</ds:X509SerialNumber>
                                       </xades:IssuerSerial>
                                    </xades:Cert>
                                 </xades:SigningCertificate>
 </xades:SignedSignatureProperties>

The value it should be this 2ab365b063238318fdeac9c2957b135ef8a6727691fc4d81982b5bdd2cec9792:

 <ds:Reference Type="http://www.w3.org/2000/09/xmldsig#SignatureProperties"
                                      URI="#xadesSignedProperties">
                           <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
                           <ds:DigestValue>2ab365b063238318fdeac9c2957b135ef8a6727691fc4d81982b5bdd2cec9792</ds:DigestValue>
</ds:Reference>

but don't know how要获得相同的摘要?

对此有任何想法吗?

I have an UBL XML file and need to hash sha256 for xadesSignedProperties and the part need to be hash is :

<xades:QualifyingProperties xmlns:xades="http://uri.etsi.org/01903/v1.3.2#" Target="signature">
                           <xades:SignedProperties Id="xadesSignedProperties">
                              <xades:SignedSignatureProperties>
                                 <xades:SigningTime>2021-02-25T12:57:51Z</xades:SigningTime>
                                 <xades:SigningCertificate>
                                    <xades:Cert>
                                       <xades:CertDigest>
                                          <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
                                          <ds:DigestValue>9ef6c0b90ae609868bb614772e1d5375464ed1a1793ded751feb1e3414980f7c</ds:DigestValue>
                                       </xades:CertDigest>
                                       <xades:IssuerSerial>
                                          <ds:X509IssuerName>CN=CommonName,O=GAZT,L=Katowice,ST=Silesia,C=PL</ds:X509IssuerName>
                                          <ds:X509SerialNumber>15007377309689649296</ds:X509SerialNumber>
                                       </xades:IssuerSerial>
                                    </xades:Cert>
                                 </xades:SigningCertificate>
 </xades:SignedSignatureProperties>

The value it should be this 2ab365b063238318fdeac9c2957b135ef8a6727691fc4d81982b5bdd2cec9792:

 <ds:Reference Type="http://www.w3.org/2000/09/xmldsig#SignatureProperties"
                                      URI="#xadesSignedProperties">
                           <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
                           <ds:DigestValue>2ab365b063238318fdeac9c2957b135ef8a6727691fc4d81982b5bdd2cec9792</ds:DigestValue>
</ds:Reference>

but don't know how to get the same DigestValue?

Any Idea about it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

自我难过 2025-02-06 07:44:50

DS:参考删除不是“ Xades:fimelyingproperties”元素,而是“ Xades:signedProperties”元素的ID ='XadessignedProperties'。
参见 xmldsig 规范有关引用XML Nodes的更多详细信息。

因此,您需要在上面复制的节点上计算哈希,而是在“ Xades:signedproperties”及其内容上计算哈希。

The ds:Reference dereferences not the 'xades:QualifyingProperties' element, but the 'xades:SignedProperties' element by its Id='xadesSignedProperties'.
See XMLDSig specification for more details about referencing XML nodes.

Therefore, you need to compute hash not on the node copied above, but on the 'xades:SignedProperties' and its content.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文