【发布时间】:2016-06-03 21:21:26
【问题描述】:
我正在做一个项目,我需要验证 xml 是否经过数字签名。
我真的很难尝试验证 XML 的关键值以供关注
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
<Reference URI=**Some URI Value**>
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
</Transform>
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>**Some Digest Value**</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>**Some Signature Value**</SignatureValue>
<KeyInfo xmlns:type="http://www.w3.org/2000/09/xmldsig#RSAKeyValue">
<RSAKeyValue><Modulus>**Some RSA Key Value**</Modulus>
<Exponent>AQAB</Exponent>
</RSAKeyValue>
</KeyInfo >
</Signature>
我无法找出如何获取
的值Reference URIDigest ValueSignature ValueRSA Modulus Value
谁能告诉我如何获得上述所有值? 在 XML Validation 中使用这些组合背后的逻辑是什么?
我使用C# 来检查验证。
你可以在我之前的问题中检查 c# 的代码
提前致谢。
【问题讨论】: