2011-11-15 108 views
0

当我尝试使用标准的RSA加密的MVC 3 web.config文件中的数据库连接字符串加密,我收到以下错误信息:MVC 3“configProtectionProvider”属性是不允许

的“configProtectionProvider”属性是不允许的。

有关如何加密MVC 3网站中的数据库连接字符串的任何想法?

代码示例

<connectionStrings configProtectionProvider="RsaProtectedConfigurationProvider"> 
    <EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element" 
     xmlns="http://www.w3.org/2001/04/xmlenc#"> 
     <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc" /> 
     <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"> 
     <EncryptedKey xmlns="http://www.w3.org/2001/04/xmlenc#"> 
      <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" /> 
      <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"> 
      <KeyName> 
       RSA Key 
      </KeyName> 
      </KeyInfo> 
      <CipherData> 
      <CipherValue> 
       WcFEbDX8VyLfAsVK8g6hZV.... 
      </CipherValue> 
      </CipherData> 
     </EncryptedKey> 
     </KeyInfo> 
     <CipherData> 
     <CipherValue> 
      OpWQgQ.... 
     </CipherValue> 
     </CipherData> 
    </EncryptedData> 
    </connectionStrings> 
+0

http://forums.asp.net/t/1771774.aspx/1 – RajeshKdev

回答

1

<configuration>节点,添加: xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"

您可能还需要有 <validation validateIntegratedModeConfiguration="false" /><system.webServer>元素,以启动服务器。