News:

Choose a design and let our professionals help you build a successful website   - ITAcumens

Main Menu

encrypt web.config using RSA key Container

Started by nandagopal, Aug 18, 2008, 12:03 PM

Previous topic - Next topic

nandagopal



<configuration>
   <connectionStrings>
<add name="SqlServices"
connectionString="Data Source=localhost;Integrated
Security=SSPI;Initial Catalog=Northwind;" />
   </connectionStrings>
</configuration>


Add a <configProtectedData> section that includes an instance of the RsaProtectedConfigurationProvider class named "MyProvider" that uses the machine-level RSA key container named "MySampleKeys."


<configuration>
   <configProtectedData>
      <providers>
         <add name="MyProvider"
    type="System.Configuration.RsaProtectedConfigurationProvider,     
    System.Configuration, Version=2.0. 0.0,
          Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a,
          processorArchitecture=MSIL"
          keyContainerName="MySampleKeys"
          useMachineContainer="true" />
      </providers>
   </configProtectedData>
   <connectionStrings>
  <add name="SqlServices" connectionString="Data Source=localhost;Integrated
Security=SSPI;Initial Catalog=Northwind;" />
   </connectionStrings>
</configuration>


Save and then close the Web.config file.