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 的位元組總數。 這個參數會被視為未初始化。

傳回

如果 destination 的長度足以接收雜湊值,則為 true;否則為 false

例外狀況

hashAlgorithm.Namenull 或空字串。

hashAlgorithm 不是已知的雜湊演算法。

適用於

另請參閱