Mentalis.org Security Library documentation

HMAC Constructor (HashAlgorithm, Byte[])

Initializes a new instance of the HMAC class.

[Visual Basic]
Overloads Public Sub New( _
   ByVal hash As HashAlgorithm, _
   ByVal rgbKey As Byte() _
)
[C#]
public HMAC(
   HashAlgorithm hash,
   byte[] rgbKey
);

Parameters

hash
The underlying hash algorithm to use.
rgbKey
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

Exception TypeCondition
ArgumentNullExceptionhash is a null reference (Nothing in Visual Basic).

See Also

HMAC Class | HMAC Members | Org.Mentalis.Security.Cryptography Namespace | HMAC Constructor Overload List