I need to encrypt/decrypt custom sections in app.config as well as web.config file. I read that aspnet_regiis can be used for web.config, but i need to do this programatically.
After opening the mappedExeConfiguration, i specify a section as follows:
ConfigurationSection connStrings = config.AppSettings;
to encrypt/decrypt the AppSettings section.
How do i specify the name of the custom section? When i type the name of my custom section after the configurationSection object, intelli-sense does not recognize it. (It only recognizes a few well known sections)
P.S. In my function, i need to take the custom section name as a string parameter.
Example:
e.g.
<Configuration>
<MyCustomTag>
<... data />
</MyCustomTag>
</Configuration>
where MyCustomTag is the section i need to encrypt/decrypt.