System.Security.Cryptography.X509Certificates.X509Certificate2.GetNameInfo Method

Gets the subject and issuer names from a certificate.

Syntax

[System.MonoTODO("always return String.Empty for UpnName, DnsFromAlternativeName and UrlName")]
public string GetNameInfo (X509NameType nameType, bool forIssuer)

Parameters

nameType
The System.Security.Cryptography.X509Certificates.X509NameType value for the subject.
forIssuer
true to include the issuer name; otherwise, false.

Returns

The name of the certificate.

Remarks

This method should always be used instead of parsing the certificate, since many of the name values can be located in multiple locations. Using this method ensures that the appropriate name is returned.

Requirements

Namespace: System.Security.Cryptography.X509Certificates
Assembly: System (in System.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0