【问题标题】:Customer WCF Bindings / Binding Elements For Encryption用于加密的客户 WCF 绑定/绑定元素
【发布时间】:2009-01-15 21:36:11
【问题描述】:

我正在尝试为我的 WCF 服务实施加密。我知道有几个选项可供我执行此操作。我对他们不感兴趣。我想使用密码重新生成可重复的 RSA 密钥。然后这些密钥将用于交换 AES 密钥,用于加密实际传递的数据。

我想我需要一个自定义绑定来执行此操作。我也有兴趣尝试简单地将我自己的绑定元素添加到 NetTCP 绑定中。有没有人尝试自定义现有的绑定,或者创建一个完全自定义的绑定?

更新 1

我真的会接受有关创建自定义绑定的任何意见。我可以启动加密部分并从那里开始工作。

更新2

我有一个客户绑定和一个自定义绑定元素。现在我正在实现 MessageEncoder.WriteMessage 的覆盖。我需要知道该消息的去向,以便我可以使用正确的加密密钥。我似乎无法访问此目标地址。

【问题讨论】:

    标签: c# .net wcf wcf-binding wcf-encryption


    【解决方案1】:

    这里有一些链接:

    Custom Bindings from MSDN documentation

    Kirk Evans Blog: WCF and Custom Bindings

    基本上你会做这样的事情:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <system.serviceModel>
        <bindings>
          <customBinding>
            <binding name="NetHttpBinding">
              <reliableSession />
              <compositeDuplex />
              <oneWay />
              <binaryMessageEncoding />
              <httpTransport />
            </binding>
          </customBinding>
        </bindings>
        <services>
          <service name="MyService">
            <endpoint
              address="http://localhost:8001/myService/"
              binding="customBinding"
              bindingConfiguration="NetHttpBinding"
              contract="MyServiceContract"
              name="HttpBinding" />
          </service>
        </services>
      </system.serviceModel>
    </configuration>
    

    第一个链接对您的帮助最大。祝你好运!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-14
      • 2011-11-20
      • 1970-01-01
      • 1970-01-01
      • 2013-08-20
      • 1970-01-01
      相关资源
      最近更新 更多