Skip to content

Instantly share code, notes, and snippets.

@garfbradaz
Created Sep 17, 2016
Embed
What would you like to do?
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