CreateHmacCryptoSha256 Method
Definition
- Namespace
- Cuemon.Security.Cryptography
- Assemblies
- Cuemon.Security.Cryptography.dll
CreateHmacCryptoSha256(byte[], Action<ConvertibleOptions>)
Creates an instance of HmacSecureHashAlgorithm256.
public static Hash CreateHmacCryptoSha256(byte[] secret, Action<ConvertibleOptions> setup = null)
Parameters
secretbyte[]The secret key for HmacSecureHashAlgorithm256 encryption. The key can be any length. However, the recommended size is 64 bytes. If the key is more than 64 bytes long, it is hashed (using SHA-256) to derive a 64-byte key. If it is less than 64 bytes long, it is padded to 64 bytes.
setupAction<ConvertibleOptions>The ConvertibleOptions which may be configured.
Returns
- Hash
A Hash implementation of HmacSecureHashAlgorithm256.
Exceptions
- ArgumentNullException
secretcannot be null.