System.Security.Cryptography.X509Certificates.X509Certificate2.ToString Method

Displays an X.509 certificate in text format.

Syntax

public override string ToString (bool verbose)

Parameters

verbose
true to display the public key, private key, extensions, and so forth; false to display information that is similar to the System.Security.Cryptography.X509Certificates.X509Certificate2 class, including thumbprint, serial number, subject and issuer names, and so on.

Returns

The certificate information.

Remarks

As with all ToString methods, the output might not be consistent across versions of the .NET Framework, so the method results should not be parsed for content. Use the properties on the System.Security.Cryptography.X509Certificates.X509Certificate2 object to obtain precise information.

This method displays the certificate in text format. If the verbose parameter is set to true, the text display includes the public key, private key, and extensions. If verbose is set to false, the text display includes those fields available from the X.509 certificate, including thumbprint, serial number, subject and issuer names, and validity date information.

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