ProtectedConfigurationSection Class
Collapse the table of content
Expand the table of content

ProtectedConfigurationSection Class

Provides programmatic access to the configProtectedData configuration section. This class cannot be inherited.

Namespace: System.Configuration
Assembly: System.Configuration (in system.configuration.dll)

public ref class ProtectedConfigurationSection sealed : public ConfigurationSection
public final class ProtectedConfigurationSection extends ConfigurationSection
public final class ProtectedConfigurationSection extends ConfigurationSection
Not applicable.

The configProtectedData configuration file section contains a collection of protected data providers in its providers element.


You can use the Aspnet_regiis.exe tool to encrypt and decrypt configuration sections. See Encrypting Configuration Information Using Protected Configuration.

The following configuration file excerpt shows how to declaratively specify protected data providers.

<configProtectedData defaultProvider="RsaProtectedConfigurationProvider">
    <clear />
      <add keyContainerName="NetFrameworkConfigurationKey" cspProviderName="" useMachineContainer="true" useOAEP="false" description="Uses RsaCryptoServiceProvider to encrypt and decrypt" name="RsaProtectedConfigurationProvider" type="System.Configuration.RsaProtectedConfigurationProvider,System.Configuration, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

      <add useMachineProtection="true" description="Uses CryptProtectData and CryptUnProtectData Windows APIs to encrypt and decrypt" keyEntropy="" name="DataProtectionConfigurationProvider" type="System.Configuration.DpapiProtectedConfigurationProvider,System.Configuration, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />


The following code example shows how to use the ProtectedConfigurationSection class to programmatically access values in the configProtectedData configuration file section.

No code example is currently available or this language may not be supported.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

© 2016 Microsoft