Skip to content

Instantly share code, notes, and snippets.

@garfbradaz
Created September 17, 2016 08:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garfbradaz/86a6927f661d981309a02f9fa9d9e976 to your computer and use it in GitHub Desktop.
Save garfbradaz/86a6927f661d981309a02f9fa9d9e976 to your computer and use it in GitHub Desktop.
app.config with a protection provider
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="CustomConfig" type="garfbradaz.Common.CustomConfigSections.EncryptedUserCredentialsSection, garfbradaz.Common" />
</configSections>
<appSettings>
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
</startup>
<CustomConfig>
<EncryptedUserCredentials>
<EncryptedUserCredential service="keyToCredential" userName="firstname.lastname" password="pwd12345@" />
</EncryptedUserCredentials>
</CustomConfig>
<configProtectedData>
<providers>
<add keyContainerName="MyCustomKeys"
useMachineContainer="true"
name="MyEncryptionProvider"
type="System.Configuration.RsaProtectedConfigurationProvider"/>
</providers>
</configProtectedData>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment