admin管理员组文章数量:1434935
I have to communicate with a soap service that requires me to sign specific parts of the message. I can configure this in soapUI, as in image below. I need to sign the WSA headers from and to, the timestamp and the body.
I cannot seem to find the correct place to configure this. I get most of the way it seems with the code below. But where in the custombinding do I specify the correct parts to sign?
WSHttpBinding binding = new WSHttpBinding();
binding.Security = new WSHttpSecurity()
{
Mode = SecurityMode.Transport,
Transport = new HttpTransportSecurity()
{
ClientCredentialType = HttpClientCredentialType.Certificate,
}
};
CustomBinding customBinding = new CustomBinding(binding);
UpdateBinding(customBinding);
private static void UpdateBinding(CustomBinding binding)
{
var sec = SecurityBindingElement.CreateCertificateOverTransportBindingElement();
sec.DefaultAlgorithmSuite = SecurityAlgorithmSuite.Basic128Sha256;
sec.IncludeTimestamp = true;
binding.Elements.Insert(0, sec);
}
本文标签: cHow to sign specific parts of a wcf client soap messageStack Overflow
版权声明:本文标题:c# - How to sign specific parts of a wcf client soap message? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745623712a2666840.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论