Sdílet prostřednictvím


IncrementalHash.CreateHMAC Metoda

Definice

Přetížení

CreateHMAC(HashAlgorithmName, Byte[])

IncrementalHash Vytvoří algoritmus HMAC (Hash-based Message Authentication Code) pomocí zadaného hash algoritmu a klíče.

CreateHMAC(HashAlgorithmName, ReadOnlySpan<Byte>)

Vytvořte IncrementalHash pro algoritmus HMAC (Hash-based Message Authentication Code) využívající hashovací algoritmus určený nástrojem hashAlgorithma klíč určený nástrojem key.

CreateHMAC(HashAlgorithmName, Byte[])

Zdroj:
IncrementalHash.cs
Zdroj:
IncrementalHash.cs
Zdroj:
IncrementalHash.cs

IncrementalHash Vytvoří algoritmus HMAC (Hash-based Message Authentication Code) pomocí zadaného hash algoritmu a klíče.

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

Parametry

hashAlgorithm
HashAlgorithmName

Název hash algoritmu, který se má provést v rámci HMAC.

key
Byte[]

Tajný klíč pro HMAC. Klíč může mít libovolnou délku, ale klíč delší, než je výstupní velikost zadaného hashovacího algoritmu, bude hashován, aby se odvozoval klíč správné velikosti. Doporučená velikost tajného klíče je proto výstupní velikost zadaného hashovacího algoritmu.

Návraty

Instance třídy připravená IncrementalHash k výpočtu zadaného hash algoritmu.

Atributy

Výjimky

key je null.

hashAlgorithm.Name je null nebo prázdný řetězec.

hashAlgorithm není známý hashovací algoritmus.

Platí pro

CreateHMAC(HashAlgorithmName, ReadOnlySpan<Byte>)

Zdroj:
IncrementalHash.cs
Zdroj:
IncrementalHash.cs
Zdroj:
IncrementalHash.cs

Vytvořte IncrementalHash pro algoritmus HMAC (Hash-based Message Authentication Code) využívající hashovací algoritmus určený nástrojem hashAlgorithma klíč určený nástrojem key.

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

Parametry

hashAlgorithm
HashAlgorithmName

Název hash algoritmu, který se má provést v rámci HMAC.

key
ReadOnlySpan<Byte>

Tajný klíč pro HMAC. Klíč může mít libovolnou délku, ale klíč delší, než je velikost výstupu hash algoritmu zadaného nástrojem hashAlgorithm , bude hashován (pomocí algoritmu zadaného v hashAlgorithm) za účelem odvození klíče správné velikosti. Doporučená velikost tajného klíče je proto výstupní velikost hodnoty hash určená nástrojem hashAlgorithm.

Návraty

Instance hodnoty hash pro výpočet hashového algoritmu určeného nástrojem hashAlgorithm.

Atributy

Výjimky

hashAlgorithm.Name je null nebo prázdný řetězec.

hashAlgorithm není známý hashovací algoritmus.

Platí pro