Initializes a new instance of the HMAC class.

Namespace: LLCryptoLib.Security.Cryptography
Assembly: LLCryptoLib (in LLCryptoLib.dll) Version: 2.0.1024.0 (2.0.1024)

Syntax

C#
public HMAC(
	HashAlgorithm hash,
	byte[] rgbKey
)
Visual Basic
Public Sub New ( _
	hash As HashAlgorithm, _
	rgbKey As Byte() _
)
Visual C++
public:
HMAC(
	HashAlgorithm^ hash, 
	array<unsigned char>^ rgbKey
)

Parameters

hash
Type: System.Security.Cryptography..::..HashAlgorithm
The underlying hash algorithm to use.
rgbKey
Type: array<System..::..Byte>[]()[][]
The key to use for the HMAC -or- a null reference (Nothing in Visual Basic).

Remarks

If rgbKey is a null reference, the HMAC class will generate a random key.

Exceptions

ExceptionCondition
System..::..ArgumentNullExceptionhash is a null reference (Nothing in Visual Basic).

See Also