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 に書き込まれた合計バイト数。 このパラメーターは初期化前として処理されます。

戻り値

Boolean

destination がハッシュ値を受け取るのに十分な長さである場合は true。それ以外の場合は false

例外

hashAlgorithm.Name は、null または空の文字列です。

hashAlgorithm は既知のハッシュ アルゴリズムではありません。

適用対象

こちらもご覧ください