Posted on: 10/21/2013 5:40:32 AM | Views : 4049

Hi All,
 I wanted to encrypt a section of my app.config file. I am renaming App.config of my windows service application to Web.config. Appling aspnet_regiis -pf to encrypt a section of the .config file. I am renaming the file back to App.config. Now when my application runs it is thowing me following exception.
Failed to decrypt using provider 'RsaProtectedConfigurationProvider'. Error message from the provider: The RSA key container could not be opened.
I think that I need to provide access right for the RSA container for the user under which my service is running!!
Following is the encrypted config setion of my file.
<databases configProtectionProvider="RsaProtectedConfigurationProvider"> <EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#"> <EncryptionMethod Algorithm="http://www.w3.org/200 ...

Go to the complete details ...