加密app.config部分

时间:2013-11-29 17:41:12

标签: c#

我有这个app.config文件:

<?xml version="1.0"?>
<configuration>
    <system.serviceModel>
        <bindings>
            <wsHttpBinding>
                <binding name="WSHttpBinding_IService">
                    <security>
                        <message clientCredentialType="UserName" />
                    </security>
                </binding>
            </wsHttpBinding>
        </bindings>
        <client>
            <endpoint address="myServiceAddress"
                binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IService"
                contract="ServiceReference1.IService" name="WSHttpBinding_IService">
                <identity>
                    <certificate encodedValue="LARGE VALUE" />
                </identity>
            </endpoint>
        </client>
    </system.serviceModel>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

如何加密system.servicemodel部分,以便没有人能够看到我的端点或者我的服务接口的名称是什么?我已经尝试过此解决方案http://www.codeproject.com/Articles/15392/Implementing-Protected-Configuration-With-Windows但是当我将sectionName参数设置为configuration时,它似乎无法正常工作。

还有其他办法吗?

0 个答案:

没有答案