Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

X509Certificate2Collection.FindByThumbprint Method

Definition

Namespace:
System.Security.Cryptography.X509Certificates
Assemblies:
netstandard.dll, System.Security.Cryptography.dll

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Overloads

Name Description
FindByThumbprint(HashAlgorithmName, ReadOnlySpan<Byte>)

Searches the collection for certificates with a matching thumbprint.

FindByThumbprint(HashAlgorithmName, ReadOnlySpan<Char>)

Searches the collection for certificates with a matching thumbprint.

FindByThumbprint(HashAlgorithmName, String)

Searches the collection for certificates with a matching thumbprint.

FindByThumbprint(HashAlgorithmName, ReadOnlySpan<Byte>)

Source:
X509Certificate2Collection.cs
Source:
X509Certificate2Collection.cs

Searches the collection for certificates with a matching thumbprint.

public:
 System::Security::Cryptography::X509Certificates::X509Certificate2Collection ^ FindByThumbprint(System::Security::Cryptography::HashAlgorithmName hashAlgorithm, ReadOnlySpan<System::Byte> thumbprintBytes);
public System.Security.Cryptography.X509Certificates.X509Certificate2Collection FindByThumbprint(System.Security.Cryptography.HashAlgorithmName hashAlgorithm, ReadOnlySpan<byte> thumbprintBytes);
member this.FindByThumbprint : System.Security.Cryptography.HashAlgorithmName * ReadOnlySpan<byte> -> System.Security.Cryptography.X509Certificates.X509Certificate2Collection
Public Function FindByThumbprint (hashAlgorithm As HashAlgorithmName, thumbprintBytes As ReadOnlySpan(Of Byte)) As X509Certificate2Collection

Parameters

hashAlgorithm
HashAlgorithmName

The name of the hash algorithm to compute the thumbprint.

thumbprintBytes
ReadOnlySpan<Byte>

The thumbprint to match.

Returns

A collection of certificates with a matching thumbprint.

Exceptions

hashAlgorithm.Name is null or empty.

hashAlgorithm specifies a hash algorithm not supported by the current platform.

hashAlgorithm specifies an unknown hash algorithm.

-or-

An error occured while finding the certificates with a matching thumbprint.

Applies to

FindByThumbprint(HashAlgorithmName, ReadOnlySpan<Char>)

Source:
X509Certificate2Collection.cs
Source:
X509Certificate2Collection.cs

Searches the collection for certificates with a matching thumbprint.

public:
 System::Security::Cryptography::X509Certificates::X509Certificate2Collection ^ FindByThumbprint(System::Security::Cryptography::HashAlgorithmName hashAlgorithm, ReadOnlySpan<char> thumbprintHex);
public System.Security.Cryptography.X509Certificates.X509Certificate2Collection FindByThumbprint(System.Security.Cryptography.HashAlgorithmName hashAlgorithm, ReadOnlySpan<char> thumbprintHex);
member this.FindByThumbprint : System.Security.Cryptography.HashAlgorithmName * ReadOnlySpan<char> -> System.Security.Cryptography.X509Certificates.X509Certificate2Collection
Public Function FindByThumbprint (hashAlgorithm As HashAlgorithmName, thumbprintHex As ReadOnlySpan(Of Char)) As X509Certificate2Collection

Parameters

hashAlgorithm
HashAlgorithmName

The name of the hash algorithm to compute the thumbprint.

thumbprintHex
ReadOnlySpan<Char>

The thumbprint to match, hex-encoded.

Returns

A collection of certificates with a matching thumbprint.

Exceptions

hashAlgorithm.Name is null or empty.

-or-

thumbprintHex contains invalid hexadecimal characters.

-or-

thumbprintHex does not decode evenly and contains an odd number of characters.

hashAlgorithm specifies a hash algorithm not supported by the current platform.

hashAlgorithm specifies an unknown hash algorithm.

-or-

An error occured while finding the certificates with a matching thumbprint.

Applies to

FindByThumbprint(HashAlgorithmName, String)

Source:
X509Certificate2Collection.cs
Source:
X509Certificate2Collection.cs

Searches the collection for certificates with a matching thumbprint.

public:
 System::Security::Cryptography::X509Certificates::X509Certificate2Collection ^ FindByThumbprint(System::Security::Cryptography::HashAlgorithmName hashAlgorithm, System::String ^ thumbprintHex);
public System.Security.Cryptography.X509Certificates.X509Certificate2Collection FindByThumbprint(System.Security.Cryptography.HashAlgorithmName hashAlgorithm, string thumbprintHex);
member this.FindByThumbprint : System.Security.Cryptography.HashAlgorithmName * string -> System.Security.Cryptography.X509Certificates.X509Certificate2Collection
Public Function FindByThumbprint (hashAlgorithm As HashAlgorithmName, thumbprintHex As String) As X509Certificate2Collection

Parameters

hashAlgorithm
HashAlgorithmName

The name of the hash algorithm to compute the thumbprint.

thumbprintHex
String

The thumbprint to match, hex-encoded.

Returns

A collection of certificates with a matching thumbprint.

Exceptions

thumbprintHex is null.

hashAlgorithm.Name is null or empty.

-or-

thumbprintHex contains invalid hexadecimal characters.

-or-

thumbprintHex does not decode evenly and contains an odd number of characters.

hashAlgorithm specifies a hash algorithm not supported by the current platform.

hashAlgorithm specifies an unknown hash algorithm.

-or-

An error occured while finding the certificates with a matching thumbprint.

Applies to


Feedback

Was this page helpful?