[英]SignedXml CanonicalizationMethod - http://www.w3.org/2006/12/xml-c14n11
Is it possible to use http://www.w3.org/2006/12/xml-c14n11 CanonicalizationMethod with SignedXml? 是否可以使用带有SignedXml的http://www.w3.org/2006/12/xml-c14n11 CanonicalizationMethod?
SignedXml signedXml = new SignedXml(xmlDoc);
signedXml.SignedInfo.CanonicalizationMethod = "http://www.w3.org/2006/12/xml-c14n11";
is throwing 扔了
System.Security.Cryptography.CryptographicException: Could not create the XML tr
ansformation identified by the URI http://www.w3.org/2006/12/xml-c14n11.
Thank You! 谢谢!
Doesn't look like it has been implemented by .NET yet. 看起来它还没有被.NET实现。
https://msdn.microsoft.com/en-us/library/system.security.cryptography.xml.signedinfo.canonicalizationmethod(v=vs.110).aspx https://msdn.microsoft.com/en-us/library/system.security.cryptography.xml.signedinfo.canonicalizationmethod(v=vs.110).aspx
You may have to make your own Transform class like this: 您可能必须像这样创建自己的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();
}
}
And map your transform to " http://www.w3.org/2006/12/xml-c14n11 ". 并将您的转换映射到“ http://www.w3.org/2006/12/xml-c14n11 ”。
CryptoConfig.AddAlgorithm(typeof(XmlDsigC14N11Transform), "http://www.w3.org/2006/12/xml-c14n11");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.