CertificateNamesCollection Class
Summary
Represents a collection of certificate names. This class is used to specify or retrieve a list of domain names associated with a certificate.
The CertificateNamesCollection class provides a way to manage multiple string values, each representing a name (typically a domain name or a wildcard) that a certificate might be valid for. It is often used in scenarios involving SSL/TLS validation or certificate pinning.
Syntax
public sealed class CertificateNamesCollection : System.Collections.Generic.ICollection<string>, System.Collections.Generic.IEnumerable<string>, System.Collections.ICollection, System.Collections.IEnumerable
Namespaces: System.Net.Security
Assembly: System (in System.dll)
Remarks
This collection is immutable once created. You cannot add or remove elements after instantiation. It is typically populated by a system or a configuration setting when working with network security protocols.
The names in the collection are case-insensitive for comparison purposes, though they are stored with their original casing.
Use this class when you need to compare a certificate's subject alternative names (SANs) or common name (CN) against a predefined list of expected names.
Requirements
| Component | Details |
|---|---|
| Supported in | .NET Framework 4.0, .NET Framework 4.5, .NET Framework 4.5.1, .NET Framework 4.5.2, .NET Framework 4.6, .NET Framework 4.6.1, .NET Framework 4.6.2, .NET Framework 4.7, .NET Framework 4.7.1, .NET Framework 4.7.2, .NET Framework 4.8, .NET Core 1.0, .NET Core 1.1, .NET Core 2.0, .NET Core 2.1, .NET Core 2.2, .NET Core 3.0, .NET Core 3.1, .NET 5, .NET 6, .NET 7, .NET 8 |
| Namespace | System.Net.Security |
| Assembly | System.dll |