MSDN

Microsoft Developer Network

Class System.Net.Security.CertificateNamesSection

Provides access to the <certificateNameMapping> section in a configuration file.

Namespace:

System.Net.Security

Assembly:

System.dll

Syntax

public sealed class CertificateNamesSection : System.Configuration.ConfigurationSection

Remarks

This class allows you to programmatically read and modify the configuration settings for certificate name mapping. This section is used to map certificate names to specific network clients or endpoints, enabling more granular control over SSL/TLS connections.

The <certificateNameMapping> section in a configuration file typically looks like this:

<configuration>
    <system.net>
        <certificateNameMapping>
            <!– Example: Map a specific certificate issuer to a service–>
            <add name="MyWebService"
                 validationFlags="AllowAnyCertificate|AllowInvalidDate"
                 x509Certificate="CN=MyServer, OU=Example, O=MyCompany, C=US"
                 x509FindType="FindBySubjectName" />
            <!– More mappings can be added here –>
        </certificateNameMapping>
    </system.net>
</configuration>
            

You can use this class to load the configuration, access individual mappings, and update them as needed.

Properties

Name Description
CertNameMappingCollection AllMappings Gets or sets the collection of certificate name mappings.
System.Configuration.ElementProperty ElementProperty Gets information about the properties of the configuration element. (Inherited from ConfigurationSection)
System.Configuration.ConfigurationLockCollection LockAttributes Gets a collection of attributes that prevent the associated configuration element from being overridden by derived configuration files. (Inherited from ConfigurationSection)
string LockExpression Gets or sets a lock expression that prevents the associated configuration element from being overridden by derived configuration files. (Inherited from ConfigurationSection)
System.Configuration.ConfigurationLockCollection LockAllAttributesExcept Gets a collection of attributes that prevent the associated configuration element from being overridden by derived configuration files. You can use this property to specify an empty list to indicate that all attributes except those specified in the LockAttributes property are locked. (Inherited from ConfigurationSection)
System.Configuration.ConfigurationLockCollection LockElements Gets a collection of elements that prevent the associated configuration element from being overridden by derived configuration files. (Inherited from ConfigurationSection)
bool LockItem Gets or sets a value indicating whether the configuration element is locked. (Inherited from ConfigurationSection)
System.Configuration.ConfigurationSection SectionInformation Gets a SectionInformation object that contains information about the configuration section. (Inherited from ConfigurationSection)

Methods

Name Description
object Evaluate () Evaluates the configuration section. (Inherited from ConfigurationSection)
void DeserializeSection(System.Xml.XmlReader reader) Deserializes a section from the specified XmlReader. (Inherited from ConfigurationSection)
void Reset(System.Configuration.ConfigurationElement parentElement) Resets all ConfigurationProperty attributes to their default values. (Inherited from ConfigurationSection)
void ResetModified() Resets the Modified property to false. (Inherited from ConfigurationSection)
bool SerializeSection(System.Xml.XmlWriter writer, string elementName) Serializes the current configuration section to the specified XmlWriter. (Inherited from ConfigurationSection)

See Also