IncrementalHash.CreateHMAC 方法

定义

重载

CreateHMAC(HashAlgorithmName, Byte[])

使用 hashAlgorithm指定的哈希算法和由 key指定的密钥,为基于哈希的消息身份验证代码(HMAC)算法创建 IncrementalHash

CreateHMAC(HashAlgorithmName, ReadOnlySpan<Byte>)

使用 hashAlgorithm指定的哈希算法和由 key指定的密钥,为基于哈希的消息身份验证代码(HMAC)算法创建 IncrementalHash

CreateHMAC(HashAlgorithmName, Byte[])

Source:
IncrementalHash.cs
Source:
IncrementalHash.cs
Source:
IncrementalHash.cs

使用 hashAlgorithm指定的哈希算法和由 key指定的密钥,为基于哈希的消息身份验证代码(HMAC)算法创建 IncrementalHash

public:
 static System::Security::Cryptography::IncrementalHash ^ CreateHMAC(System::Security::Cryptography::HashAlgorithmName hashAlgorithm, cli::array <System::Byte> ^ key);
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public static System.Security.Cryptography.IncrementalHash CreateHMAC (System.Security.Cryptography.HashAlgorithmName hashAlgorithm, byte[] key);
public static System.Security.Cryptography.IncrementalHash CreateHMAC (System.Security.Cryptography.HashAlgorithmName hashAlgorithm, byte[] key);
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
static member CreateHMAC : System.Security.Cryptography.HashAlgorithmName * byte[] -> System.Security.Cryptography.IncrementalHash
static member CreateHMAC : System.Security.Cryptography.HashAlgorithmName * byte[] -> System.Security.Cryptography.IncrementalHash
Public Shared Function CreateHMAC (hashAlgorithm As HashAlgorithmName, key As Byte()) As IncrementalHash

参数

hashAlgorithm
HashAlgorithmName

在 HMAC 中执行的哈希算法的名称。

key
Byte[]

HMAC 的密钥。

返回

IncrementalHash 实例已准备好计算由 hashAlgorithm指定的哈希算法。

属性

例外

key null

hashAlgorithmNamenull或空字符串。

hashAlgorithm 不是已知的哈希算法。

适用于

CreateHMAC(HashAlgorithmName, ReadOnlySpan<Byte>)

Source:
IncrementalHash.cs
Source:
IncrementalHash.cs
Source:
IncrementalHash.cs

使用 hashAlgorithm指定的哈希算法和由 key指定的密钥,为基于哈希的消息身份验证代码(HMAC)算法创建 IncrementalHash

public:
 static System::Security::Cryptography::IncrementalHash ^ CreateHMAC(System::Security::Cryptography::HashAlgorithmName hashAlgorithm, ReadOnlySpan<System::Byte> key);
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public static System.Security.Cryptography.IncrementalHash CreateHMAC (System.Security.Cryptography.HashAlgorithmName hashAlgorithm, ReadOnlySpan<byte> key);
public static System.Security.Cryptography.IncrementalHash CreateHMAC (System.Security.Cryptography.HashAlgorithmName hashAlgorithm, ReadOnlySpan<byte> key);
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
static member CreateHMAC : System.Security.Cryptography.HashAlgorithmName * ReadOnlySpan<byte> -> System.Security.Cryptography.IncrementalHash
static member CreateHMAC : System.Security.Cryptography.HashAlgorithmName * ReadOnlySpan<byte> -> System.Security.Cryptography.IncrementalHash
Public Shared Function CreateHMAC (hashAlgorithm As HashAlgorithmName, key As ReadOnlySpan(Of Byte)) As IncrementalHash

参数

hashAlgorithm
HashAlgorithmName

在 HMAC 中执行的哈希算法的名称。

key
ReadOnlySpan<Byte>

HMAC 的密钥。

返回

用于计算由 hashAlgorithm指定的哈希算法的哈希实例。

属性

例外

hashAlgorithmNamenull 或空字符串。

hashAlgorithm 不是已知的哈希算法。

适用于