Cannot decrypt Enterprise Library

Topics: General discussion
May 3, 2009 at 6:41 AM
I have encrypted Data application block using RSA encryption via the VisualStudio-integrated enterprise library configuration editor.
I can open the config file using the same and see all encrypted data fine.
However when I use the stand alone configuration editor, I am getting error "Failed to decrypt using provider 'RsaProtectedConfigurationProvider'...." and "The RSA key container could not be opened."
This is on the same machine, so I don't think it's an issue with key cannot be found, but it seems to work only with one set of config editor and not with another.
I have not changed the default Enterprise library configuration setting under Solution properties, because I cannot find this setting on the properties dialog box. So I think I am still using the Enterprise Library files set that is in C:\Program Files\..
May 4, 2009 at 3:18 AM
I tried to repro your case but I wasn't able to, I was able to open my config successfully on the stand alone config editor.  Could you post your exact steps?

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
May 4, 2009 at 3:33 AM
hmmm. could it be my operating system? I'm using vista ultimate.
After encrypting the config using visual studio config editor, I went to C:\Program Files\Microsoft Enterprise Library 4.1 - October 2008\Bin
and double clicked EntLibConfig.exe
From there I opened the config file I just encrypted.
Oh, I'm using Configuration Source from web.config to a separate config file. It is this separate config file that I encrypted.
Opening web.config with stand alone config editor yields same result by the way.

Thanks for looking into this.

May 4, 2009 at 3:58 AM
I opened both config and both works fine.  I don't know of any issues regarding this that has something to do with the operating system.  Could you post your exact steps?  We might be missing something.

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
May 4, 2009 at 4:51 AM
I have solved this. Apparently I need to righ click on EntLibConfig.exe and choose run as administrator.
I have to do the same whenever I open my VS2008. Doh..why didn't I think of that?
Thanks Sarah for your assistance.

May 4, 2009 at 5:08 AM
Yeah, same reaction here!  The usual "Run as Administrator" thing in Vista.  Glad it's working now.

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.