CryptographicOperations.TryHmacData Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Tenta di calcolare l'HMAC dei dati.
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
Parametri
- hashAlgorithm
- HashAlgorithmName
Algoritmo usato per calcolare il codice HMAC.
- key
- ReadOnlySpan<Byte>
Chiave privata. La chiave può essere qualsiasi lunghezza.
- source
- ReadOnlySpan<Byte>
Dati su cui calcolare il codice HMAC.
- bytesWritten
- Int32
Quando termina, il numero totale di byte scritti in destination.
Restituisce
false se destination è troppo piccolo per contenere l'HMAC calcolato, true in caso contrario.
Eccezioni
hashAlgorithm ha un Name vuoto.
hashAlgorithm ha un Namenull.
hashAlgorithm specifica un algoritmo hash non supportato dalla piattaforma corrente.
hashAlgorithm specifica un algoritmo hash sconosciuto.