Class ConfigSectionProtection
Wrapper around the ASP.NET 2.0 feature of protecting data in web.config (as in encrypt). This class handles the sections which is supported in EPiServer. This meens it handles the sections which are connected with the checkbox for web.config protection in the admin UI.
Inheritance
Inherited Members
Namespace: EPiServer.Security
Assembly: EPiServer.Cms.AspNet.dll
Version: 11.20.7Syntax
public class ConfigSectionProtection
Constructors
ConfigSectionProtection()
Declaration
public ConfigSectionProtection()
Properties
DefaultProtectionProvider
Gets the default protection provider used.
Declaration
public static string DefaultProtectionProvider { get; }
Property Value
Type | Description |
---|---|
System.String |
ProtectionSectionsSupported
Gets a list of the section groups supported for protection.
Declaration
public static string[] ProtectionSectionsSupported { get; }
Property Value
Type | Description |
---|---|
System.String[] |
Methods
GetProtectedConfigSections(Configuration)
From the list of supported config sections for protection scans the config and returns the list of currently protected sections.
Declaration
public static IList<string> GetProtectedConfigSections(Configuration config)
Parameters
Type | Name | Description |
---|---|---|
System.Configuration.Configuration | config | Configuration to scan. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<System.String> | List of config section names which have protected data. |
HasProtectedConfigSections(Configuration)
By "scanning" the supported sections for protection checks is any is currently protected.
Declaration
public static bool HasProtectedConfigSections(Configuration config)
Parameters
Type | Name | Description |
---|---|---|
System.Configuration.Configuration | config | Configuration to scan. |
Returns
Type | Description |
---|---|
System.Boolean | Flag indicating protected section(s). |
SaveConfigSectionsProtected(Configuration, Boolean)
Saves the sections in Configuration supported and potential security threat protected or in clear text.
Declaration
public static void SaveConfigSectionsProtected(Configuration config, bool protect)
Parameters
Type | Name | Description |
---|---|---|
System.Configuration.Configuration | config | Configuration to save. |
System.Boolean | protect | Flag indicating protection. |
Remarks
NOTE that this method also saves the config file to the physical drive.