X509Certificate.TryGetCertHash Метод

Определение

Пытается создать "отпечаток" для сертификата, хэшируя закодированное представление сертификата с указанным хэш-алгоритмом.

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

Параметры

hashAlgorithm
HashAlgorithmName

Алгоритм, используемый для отпечатка.

destination
Span<Byte>

Буфер для получения отпечатка сертификата.

bytesWritten
Int32

При возврате этого метода общее количество байтов, записанных в destination. Этот параметр рассматривается как неинициализированный.

Возвращаемое значение

true Значение , если destination достаточно долго, чтобы получить хэш-значение; в противном случае false.

Исключения

hashAlgorithm.Name имеет null или пустую строку.

hashAlgorithm не является известным хэш-алгоритмом.

Применяется к

См. также раздел