I tried to encrypt web.config using the commands
cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319
aspnet_regiis.exe -pc "CustomKeys16" -exp
aspnet_regiis.exe -pa "CustomKeys16" "NT AUTHORITY\NETWORK SERVICE"
aspnet_regiis -pef "connectionStrings" "C:\Users\cnandy\Desktop\Test\Websites\AccountDeduplicationWeb" -prov "CustomProvider"
aspnet_regiis -px "CustomKeys16" "C:\Users\cnandy\Desktop\New folder\encrypt.xml" -pri
they work fine first time.
Now after decryption and changing something in the web config connection string if I again try to encrypt using the commands it shows the errors.
1. The RSA Key Container already exists ...
Failed !!
2.
Adding ACL for access to the RSA Key container...
Succeeded!
3.
Encrypting configuration section...
Succeeded!
4.
C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis -px "CustomKeys16"
"C:\Users\cnandy\Desktop\New folder\encrypt.xml" -priExporting RSA Keys to file...
Key not valid for use in specified state. Please help as I am running out of ideas.
Can't be it possible to re-run the encryption after modifying web.config and export successfully the key ?