Table of Contents

CreateHmacCrypto Method

Definition

Namespace
Cuemon.Security.Cryptography
Assemblies
Cuemon.Security.Cryptography.dll
Source
src/Cuemon.Security.Cryptography/KeyedHashFactory.cs

CreateHmacCrypto(byte[], KeyedCryptoAlgorithm, Action<ConvertibleOptions>)

Creates an instance of a HMAC cryptographic implementation that derives from KeyedCryptoHash<TAlgorithm> with the specified algorithm. Default is HmacSecureHashAlgorithm256.

public static Hash CreateHmacCrypto(byte[] secret, KeyedCryptoAlgorithm algorithm = KeyedCryptoAlgorithm.HmacSha256, Action<ConvertibleOptions> setup = null)

Parameters

secret byte[]

The secret key for the encryption.

algorithm KeyedCryptoAlgorithm

The KeyedCryptoAlgorithm that defines the HMAC cryptographic implementation. Default is HmacSha256.

setup Action<ConvertibleOptions>

The ConvertibleOptions which may be configured.

Returns

Hash

A Hash implementation of the by parameter specified algorithm.

Exceptions

ArgumentNullException

secret cannot be null.