Last active
August 29, 2015 13:56
-
-
Save caevyn/8909279 to your computer and use it in GitHub Desktop.
Separate encrypted app settings section
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var section = (NameValueCollection)ConfigurationManager.GetSection("secureAppSettings"); | |
var key = section["encryptMe"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configuration> | |
<configSections> | |
<section name="secureAppSettings" type="System.Configuration.NameValueSectionHandler, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> | |
</configSections> | |
<secureAppSettings> | |
<add key="encryptMe" value="ImSuperSecret" /> | |
</secureAppSettings> | |
</configuration> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Then run aspnet_regiis to encrypt that section. http://msdn.microsoft.com/en-us/library/k6h9cz8h(v=vs.80).aspx