Decrypting a connection string in a web.config file

mike55

Contributor
Joined
Mar 26, 2004
Messages
727
Location
Ireland
Hi all

I have the a web.config file, that has a encrypted connection string in it. 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

I have found that I need to decrypt the key using the following command in the dos prompt:
Code:
aspnet_regiis.exe -pd "connectionStrings" -app "/connectionTest"

The problem that I am encountering at the moment is I am unsure what to submit in as the "connectionStrings" and "/connectionTest". Has anyone employed this command before?

Mike55.
 
I didn't know aspnet_regiis did those extra things...very good to know...as to your problem...is it possible that you're encrypting on one machine and then trying to decrypt on another. Maybe this is stating the obvious but if not...the encryption is probably based upon machine specific keys...but I don't think that's the case reading your post but you know how it is, the obvious problem is sometime ignored...anyway...

I did figure out that 'section' refers to something like:

Code:
  <section name="customHandler" type="blah...." />

And I'm calling this like:

aspnet_regiis -pe "customHanlder" -app "/MySite"

But I'm getting an error on that. Documentation isn't much help. Let me know if you find any more on this, I'm interested to know about it myself now.
 
Funny feeling that you are correct regarding the source of my problems with the decryption, as it was another developer who started the encryption and decryption and then went home with his machine.

Mike55.
 
Back
Top