在WCF中保护和签名消息

时间:2012-09-12 09:40:13

标签: wcf wcf-security x509certificate digital-signature

我是这个梦幻网站的新成员,这是我的第一个问题.. 我希望我能找到解决方案..

我正在建立一个网站,我需要保护客户端和服务器之间的通信。

我应该在实现中使用WCF。

我的项目要求:

  • 使用WCF
  • 绑定:ws2007HttpBinding
  • 安全:HTTPS
  • 客户:签名

我应该使用HTTPS来保护通信,我应该让客户签署消息(这很重要)。

我在服务器和客户端安装证书但我不知道如何让客户签署消息。

我不能在wcf中使用消息安全性,因为我需要HTTPS。任何人都可以帮助我了解TransportWithMessageCredential为签名做什么以及如何实现这样的事情?

以下是服务器的app.config的一部分:

<bindings>
    <ws2007HttpBinding>
        <binding name="ServiceWS2007HttpBindingConfg">
            <security mode="TransportWithMessageCredential">
                <transport clientCredentialType="None" />
                <message clientCredentialType="Certificate" negotiateServiceCredential="false" />
            </security>
        </binding>
    </ws2007HttpBinding>
</bindings>
<services>
    <service name="Service">
        <endpoint address="https://MAHER-PC/EBPP/Service.svc" binding="ws2007HttpBinding"
         bindingConfiguration="ServiceWS2007HttpBindingConfg" contract="IService" />
    </service>
</services>

感谢....

1 个答案:

答案 0 :(得分:0)

取决于您计划签署的内容。

一个好的开始是查看在服务合同中为您的服务设置ProtectionLevel。

信息:

http://msdn.microsoft.com/en-gb/library/aa347692.aspx

如何:

http://msdn.microsoft.com/en-gb/library/aa347791.aspx

相关问题