Encrypting entlib.config with relative path key file

Few days ago at work, I was tweaking the enterprise library tool to encrypt the config files. This is a fairly easy task and can be acheived using "Encryption settings" on the configuration application block.

However, once concern our client raised was specification of the algorithm key file location using full physical path. Instead, they were looking to reference it using a relative path something like "~/encrypt.key". Configuration block by default does not support relative path. However, making it read relative path is achieveable by tinkering the configuration block. 'FileKeyAlgorithmPairStorageProviderData' in the enterprise library configuration project contains attribute for path, this path is directly passed as parameter. Instead, the path parameter can be resolved on need basis to either reference from physical location or relative location. I don't have a coded dll yet but I'll come up with one soon.

<

 

<

keyAlgorithmStorageProvider xsi:type="FileKeyAlgorithmPairStorageProviderData" name="File Key Algorithm Storage Provider" path="C:\projects\encrypt.key">dpapiSettings xsi:nil="true" />

Print | posted on Friday, September 29, 2006 9:14 PM

Feedback

# re: Encrypting entlib.config with relative path key file

Left by Shahaji Udar at 10/14/2008 5:07 AM
Gravatar Hi, i migrated my asp.net 1.1 application to 2.0.

I'm getting error :

error parsing application configuration file at xsi:nil attribute on element '' is invalid asp.net

for node dpapiSettings xsi:nil="true"

Please reply if you know any solution.

Regards,
Shahaji Udar

Your comment:





 
Please add 3 and 6 and type the answer here:

Copyright © Bigyan Rajbhandari