DAAB Connection string Encryption

Topics: Data Access Application Block
Sep 6, 2007 at 5:49 AM
Hi,
I am using EntLib 3.1 Data Access Applicaiton Block for my Data Layer.I am encrypting the connection string using Ent Lib Configuration tool, using the "'RsaProtectedConfigurationProvider'". It is working in my local machine. But when i deployed in production, i am getting the following error.
Failed to decrypt using provider 'RsaProtectedConfigurationProvider'. Error message from the provider: The RSA key container could not be opened.
Please help.

Thanks in advance,
Sudheer
Sep 6, 2007 at 12:36 PM
Hi,

You need to both make the encryption key available to your production server and grant access to the key container to the account running your web application.
Here are some links that will help you:
  • http://blogs.msdn.com/mosharaf/archive/2005/11/17/protectedConfiguration.aspx
  • http://msdn2.microsoft.com/en-us/library/2w117ede.aspx

Hope this helps,
Fernando
Oct 21, 2008 at 11:34 AM
Hi,

I am using EntLib 4.0 and encrypted my ASP.NET application connection string. When deploying on a server I get the "Failed to decrypt using provider 'RsaProtectedConfigurationProvider'. Error message from the provider: The RSA key container could not be opened." message.

When trying to export the key using :
aspnet_regiis -px "NetFrameworkConfigurationKey" "c:\temp\keys.xml" -pri

I get a message telling me that the container is not found.

Any idea?
Oct 22, 2008 at 8:30 AM
Hi, see this thread,  http://www.codeplex.com/entlib/Thread/View.aspx?ThreadId=10300
Oct 23, 2008 at 6:25 PM
Hi,

When sharing encrypted configuration you need to use a key container of your own, which requires declaring a new protected configuration provider. Check out http://msdn.microsoft.com/en-us/library/ms998283.aspx#paght000006_webfarmscenarios for details.

Hope this helps,
Fernando