X509Certificate2.IssuerName Property

Property .NET .NET Framework .NET Core

On this page

Summary

Gets the issuer name of the X.509 certificate.

Syntax

public override string IssuerName { get; }

Property Value

A string that contains the issuer name of the X.509 certificate.

Examples

The following example creates an X509Certificate2 object from a certificate file and displays the issuer name.

using System;
using System.Security.Cryptography.X509Certificates;

public class Example
{
    public static void Main(string[] args)
    {
        try
        {
            // Replace with the actual path to your certificate file
            string certificatePath = "mycertificate.pfx";
            string certificatePassword = "mypassword";

            X509Certificate2 certificate = new X509Certificate2(certificatePath, certificatePassword);

            Console.WriteLine("Certificate Issuer Name: {0}", certificate.IssuerName.Name);
        }
        catch (CryptographicException e)
        {
            Console.WriteLine("An error occurred when processing the certificate.");
            Console.WriteLine(e.Message);
        }
    }
}

Remarks

The IssuerName property returns a string that represents the Distinguished Name (DN) of the certificate issuer. This name typically includes attributes such as Common Name (CN), Organization (O), and Country (C).

The X509Certificate2.IssuerName property is an override of the System.Security.Cryptography.X509Certificates.X509Certificate.IssuerName property. The returned string is formatted according to RFC 2253.

See Also