X509Certificate.TryGetCertHash(HashAlgorithmName, Span<Byte>, Int32) Método

Definição

Tenta produzir uma "impressão digital" para o certificado por meio do hash da representação codificada do certificado com o algoritmo de hash especificado.Attempts to produce a "thumbprint" for the certificate by hashing the encoded representation of the certificate with the specified hash algorithm.

public:
 virtual bool TryGetCertHash(System::Security::Cryptography::HashAlgorithmName hashAlgorithm, Span<System::Byte> destination, [Runtime::InteropServices::Out] int % bytesWritten);
public virtual bool TryGetCertHash (System.Security.Cryptography.HashAlgorithmName hashAlgorithm, Span<byte> destination, out int bytesWritten);
abstract member TryGetCertHash : System.Security.Cryptography.HashAlgorithmName * Span<byte> * int -> bool
override this.TryGetCertHash : System.Security.Cryptography.HashAlgorithmName * Span<byte> * int -> bool
Public Overridable Function TryGetCertHash (hashAlgorithm As HashAlgorithmName, destination As Span(Of Byte), ByRef bytesWritten As Integer) As Boolean

Parâmetros

hashAlgorithm
HashAlgorithmName

O algoritmo a ser usado para a impressão digital.The algorithm to use for the thumbprint.

destination
Span<Byte>

O buffer que receberá a impressão digital do certificado.The buffer to receive the certificate thumbprint.

bytesWritten
Int32

Quando esse método é retornado, o número total de bytes gravados em destination.When this method returns, the total number of bytes written into destination. Esse parâmetro é tratado como não inicializado.This parameter is treated as uninitialized.

Retornos

Boolean

true se destination for longo o suficiente para receber o valor de hash; caso contrário, false.true if destination is long enough to receive the hash value; otherwise, false.

Exceções

hashAlgorithm.NamehashAlgorithm.Name é null ou uma cadeia de caracteres vazia.is null or an empty string.

hashAlgorithm não é um algoritmo de hash conhecido.hashAlgorithm is not a known hash algorithm.

Aplica-se a

Confira também