gpt4 book ai didi

c# - SignedXml CanonicalizationMethod - http ://www. w3.org/2006/12/xml-c14n11

转载 作者:太空狗 更新时间:2023-10-29 21:53:55 33 4
gpt4 key购买 nike

是否可以使用 http://www.w3.org/2006/12/xml-c14n11使用 SignedXml 的 CanonicalizationMethod?

SignedXml signedXml = new SignedXml(xmlDoc);
signedXml.SignedInfo.CanonicalizationMethod = "http://www.w3.org/2006/12/xml-c14n11";

正在 throw

System.Security.Cryptography.CryptographicException: Could not create the XML tr
ansformation identified by the URI http://www.w3.org/2006/12/xml-c14n11.

谢谢!

最佳答案

看起来它还没有被 .NET 实现。

https://msdn.microsoft.com/en-us/library/system.security.cryptography.xml.signedinfo.canonicalizationmethod(v=vs.110).aspx

您可能必须像这样创建自己的 Transform 类:

public class XmlDsigC14N11Transform: XmlDsigC14NTransform
{
public override void LoadInput(object obj)
{
//do something here
base.LoadInput(obj);
}

public override object GetOutput()
{
//do something here
return base.GetOutput();
}
}

并将您的转换映射到“http://www.w3.org/2006/12/xml-c14n11”。

CryptoConfig.AddAlgorithm(typeof(XmlDsigC14N11Transform), "http://www.w3.org/2006/12/xml-c14n11");

关于c# - SignedXml CanonicalizationMethod - http ://www. w3.org/2006/12/xml-c14n11,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27188280/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com