CryptographicOperations.TryHmacData Método

Definição

Tentativas de calcular o HMAC dos dados.

public:
 static bool TryHmacData(System::Security::Cryptography::HashAlgorithmName hashAlgorithm, ReadOnlySpan<System::Byte> key, ReadOnlySpan<System::Byte> source, Span<System::Byte> destination, [Runtime::InteropServices::Out] int % bytesWritten);
public static bool TryHmacData(System.Security.Cryptography.HashAlgorithmName hashAlgorithm, ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten);
static member TryHmacData : System.Security.Cryptography.HashAlgorithmName * ReadOnlySpan<byte> * ReadOnlySpan<byte> * Span<byte> * int -> bool
Public Shared Function TryHmacData (hashAlgorithm As HashAlgorithmName, key As ReadOnlySpan(Of Byte), source As ReadOnlySpan(Of Byte), destination As Span(Of Byte), ByRef bytesWritten As Integer) As Boolean

Parâmetros

hashAlgorithm
HashAlgorithmName

O algoritmo utilizado para calcular o HMAC.

key
ReadOnlySpan<Byte>

A chave secreta. A chave pode ter qualquer comprimento.

source
ReadOnlySpan<Byte>

Os dados para calcular o HMAC sobre.

destination
Span<Byte>

O buffer para receber o valor HMAC.

bytesWritten
Int32

Quando este método retorna, contém o número total de bytes escritos em destination.

Devoluções

false se destination for demasiado pequeno para conter o HMAC calculado, true caso contrário.

Exceções

hashAlgorithm tem um Name que está vazio.

hashAlgorithm tem um Name que é null.

hashAlgorithm especifica um algoritmo de hash não suportado pela plataforma atual.

hashAlgorithm especifica um algoritmo de hash desconhecido.

Aplica-se a