【发布时间】:2011-05-31 17:39:50
【问题描述】:
我正在尝试为 XML 数字签名实现一个例程,并且我能够正确计算要签名的信息的哈希值。但是,我遇到了签名本身的问题,因为我无法创建要签名的真实字符串。
现在我有这个:
<SignedInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod>
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></SignatureMethod>
<Reference URI="">
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform>
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
<DigestValue>eDSx9uS7oB++bnG/6tGiD/l8374=</DigestValue>
</Reference>
</SignedInfo>
仅使用 CR 而不是 CRLF。缩进没有空格(帖子显示标签之间有空格的地方,有一个CR)
计算有效签名的任何建议?
P.D.我已将规范化算法更改为 EXCLUSIVE 并且它可以工作,但要求是使用 INCLUSIVE。
非常感谢。
【问题讨论】:
标签: xml cryptography digital-signature canonicalization xml-signature