ProtectedKeyFileName (Crypto Block)

Topics: Cryptography Application Block
May 2, 2007 at 7:24 PM
Error using relative paths for protectedKeyFilename

If I use an ABSOLUTE path it works fine.

If i use
protectedKeyFilename="MyKeys/MyKey.key", I get an error
Could not find a part of the path 'C:\WINDOWS\system32\MyKeys\MyKey.key"


If i use
protectedKeyFilename="/MyKeys/MyKey.key", I get an error
if I use Could not find a part of the path 'C:\MyKeys\SAM2symprovider.key'.

I am running the application out of IIS from the app root.
Why is it looking in the windows\systems32 folder?

How can I specify a relative folder from my website root?
May 3, 2007 at 2:50 AM
I would have thought that relative paths would be fine, but I pulled this from the documentation within the section Managing and Distributing Keys which is pretty specific about the need for absolute paths:

"The Cryptography Application Block stores each key in a separate file on the local computer. The <securityCryptographyConfiguration> section in the configuration source contains the absolute path to each key file. For example, when you use the default configuration source, the application configuration file contains the absolute path to the keys."

Absolute paths sounds like a requirement.

Regards,

Dave

____________________________

David Hayden
Microsoft MVP C#
May 3, 2007 at 3:21 PM
Thanks Dave: But where do I get the documenation from? The documenation that's installed from the download is VERY scanty. I certainly cannot find documenation anywhere that even includes "Managing and Distributing Keys" Where did you get your documentation?

Any help on this is appreciated. - I'll take one even if it's draft.

Sam


DavidHayden wrote:
I would have thought that relative paths would be fine, but I pulled this from the documentation within the section Managing and Distributing Keys which is pretty specific about the need for absolute paths:

"The Cryptography Application Block stores each key in a separate file on the local computer. The <securityCryptographyConfiguration> section in the configuration source contains the absolute path to each key file. For example, when you use the default configuration source, the application configuration file contains the absolute path to the keys."

Absolute paths sounds like a requirement.

Regards,

Dave

____________________________

David Hayden
Microsoft MVP C#

May 31, 2007 at 8:34 PM


Absolute paths sounds like a requirement.



This is a horrible requirement. Any creative ideas for a work around? We currently extended the enterprise library to allow the use of environment variables and relative paths, but extending it for this and only this creates a lot of headaches when using the software factories. We currently have a click once application that needs to install the keyfile on the clients computers. So any ideas on how to remove our need of extending the library for this would be much appreciated.