X509Certificate2.GetThumbprint Method
Namespace: System.Net.Security
Assembly: System.dll
Syntax
public string GetThumbprint();
Remarks
The thumbprint of an X.509 certificate is a hash of the certificate's public key. It is a unique identifier for the certificate and can be used to compare certificates. This method returns the thumbprint as a hexadecimal string.
The thumbprint is computed using the SHA-1 hashing algorithm.
Return Value
A string that contains the thumbprint of the certificate. The thumbprint is a hexadecimal representation of the SHA-1 hash.
Examples
// Assuming 'cert' is an instance of X509Certificate2
string thumbprint = cert.GetThumbprint();
Console.WriteLine($"Certificate Thumbprint: {thumbprint}");