Skip to content

Instantly share code, notes, and snippets.

@weirdpattern
Last active July 19, 2018 20:24
Show Gist options
  • Save weirdpattern/62d4565f1288362ae87f355fb0e1802d to your computer and use it in GitHub Desktop.
Save weirdpattern/62d4565f1288362ae87f355fb0e1802d to your computer and use it in GitHub Desktop.
.2016.11.01.encrypt-config-file-system
2016.11.01.encrypt-config-file-system
# Given a configuration fle like
# <configuration>
# <configProtectedData>
# <providers>
# <add name="MyProtectedConfigurationProvider"
# type="System.Configuration.RsaProtectedConfigurationProvider, ..."
# keyContainerName="MyKeyContainer"
# useMachineContainer="true" />
# </providers>
# </configProtectedData>
# </configuration>
$ cd "$env.WINDIR/Microsoft.NET/Framework64/v4.0.30319"
$ .\aspnet_regiis -pef "connectionStrings" "C:/inetpub/Application/" -prov "MyProtectedConfigurationProvider"
Microsoft (R) ASP.NET RegIIS version 4.0.30319.18408
Administration utility to install and uninstall ASP.NET on the local machine.
Copyright (C) Microsoft Corporation. All rights reserved.
Encrypting configuration sections...
Succeeded!
aspnet_regiis -pef <section> <directory> -prov <provider> [-pkm]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment