开发者

using the enterprise library 5 to encrypt my connection strings and appSetting

I have a wpf4 that I am referenced the enterprise library 5. I 开发者_运维百科want to encrypt my connectionstrings and appsettings but I am not 100% sure how to do this.

Can anyone point me in the right direction for encrypting using the entlib5. There seems only to be useful information out there for the version 3.1 & 4.

Any help would be great!


To encrypt a configuration section using Enterprise Library 5:

  1. Open one of the Enterprise Library configuration tools.
  2. Open an existing configuration file or create a new one.
  3. Click the chevron arrow at the right of name of the application block whose configuration information you want to encrypt.
  4. In the Properties pane, click the drop-down list for the Protection Provider property.
  5. Select either DataProtectionConfigurationProvider or RsaProtectedConfigurationProvider.

As per this url:

Encrypting Configuration Data

http://msdn.microsoft.com/en-us/library/ff664594(v=pandp.50)


The Enterprise Library Configuration Application Block Console. You can open app.configs and web.configs with this and just select what encryption provider you want to use, and viola, your section is now encrypted.


Right click on App.config and select "Edit Enterprise Library V5 Configuration". You will see two settings: Application Settings and Database Settings. Click the right arrow icon to toggle the general setting (very unfriendly UI :P). Click the drop-down list for Protection and then select RsaProtectedConfigurationProvider. Done :)


Encrypting parts of the configuration file is a feature of .NET and is transparent for any code reading the configuration file through the .NET configuration API.

You can read more about encrypting configuration files here or use our good old friend.


To encrypt your configuration data with the EntLib config tool, follow these steps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜