Error: RSA Key container could not be opened

Hi. Not sure where to put this but I'm getting an error with web service when it decrypts it's config file. I'm encrypting my connectionStrings section of web.config file with the RSA provider. But on decryption I get error : "Failed to decrypt using provider 'RsaProtectedConfigurationProvider' RSA Key container could not be opened."

As per the link below, I've used aspnet_regiis to give key container access to NT AUTHORITY/SYSTEM, ASPNET, and others but no luck.

http://blogs.msdn.com/mohamed_sharafs_blog/archive/2005/11/17/protectedConfiguration.aspx CommentPosted=true#commentmessage

Please help. Thank you!



Answer this question

Error: RSA Key container could not be opened

  • hguo98

    This has been resolved. I had my servers mixed up.

    It was pointed out to me that the decryption is taking place on the deployment server. So I needed, in this case, to do the encryption on the deployment server also.

    So the deployment project deploys an unencrypted web.config file, then after deployment it is encrypted (manually) with aspnet_regiis.


  • Error: RSA Key container could not be opened