Namespace: System.Net.Security
X509Certificate2.Issuer Property
Gets the issuer of the X.509 certificate.
public string Issuer { get; }
Remarks
The Issuer property contains the name of the certificate authority (CA) that issued the X.509 certificate. This value is represented as a distinguished name (DN) string. For example, "CN=Microsoft Code Signing PCA 2011, O=Microsoft Corporation, L=Redmond, S=Washington, C=US".
This property is read-only. The issuer information is embedded within the certificate itself.
Requirements
| Product | Version |
|---|---|
| .NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 |
| .NET Core | 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1 |
| .NET | 5.0, 6.0, 7.0, 8.0 |
| Standard libraries | 2.0, 2.1, 3.0, 4.0 |
See Also
- X509Certificate2 Class
- X509Certificate2.Subject Property
- X509Certificate2.Thumbprint Property
- System.Net.Security Namespace
Example
The following code example demonstrates how to retrieve and display the issuer name of an X.509 certificate.
using System;
using System.Security.Cryptography.X509Certificates;
public class CertificateIssuerExample
{
public static void Main(string[] args)
{
try
{
// Load a certificate from the CurrentUser/My store
X509Store store = new X509Store(StoreName.My, StoreLocation.CurrentUser);
store.Open(OpenFlags.ReadOnly);
if (store.Certificates.Count > 0)
{
// Take the first certificate for demonstration
X509Certificate2 certificate = store.Certificates[0];
Console.WriteLine($"Certificate Subject: {certificate.Subject}");
Console.WriteLine($"Certificate Issuer: {certificate.Issuer}");
Console.WriteLine($"Certificate Thumbprint: {certificate.Thumbprint}");
}
else
{
Console.WriteLine("No certificates found in the CurrentUser/My store.");
}
store.Close();
}
catch (Exception ex)
{
Console.WriteLine($"An error occurred: {ex.Message}");
}
}
}
Last modified: 2023-10-27