HMAC Class
Namespace: Rebex.Security.Cryptography
Assembly: Rebex.Common.dll (version 7.0.9083)
Computes a Hash-based Message Authentication Code (HMAC) for the input data using the specified hash function.
Syntax
public class HMAC : KeyedHashAlgorithm, ICryptoTransform, IHashTransform, IDisposable
Inherited Members
Remarks
HMAC is defined by RFC 2104 and look like this:
alg(K XOR opad + alg(K XOR ipad + text))
where alg is the base hash algorithm,
K is an n byte key,
ipad is the byte 0x36 repeated 64 times (or 128 times),
opad is the byte 0x5c repeated 64 times (or 128 times),
and text is the data being protected.
Constructors
Name | Description |
---|---|
HMAC(HashingAlgorithmId) | Initializes a new instance of the HMAC class with the specified hash algorithm and a randomly generated key. |
HMAC(HashingAlgorithmId, Byte[]) | Initializes a new instance of the HMAC class with the specified hash algorithm and key data. |
Properties
Name | Description |
---|---|
Key | Gets or sets the key to be used in the hash algorithm. |
Methods
Name | Description |
---|---|
Dispose(Boolean) | Releases the unmanaged resources used by the HMAC and optionally releases the managed resources. |
HashCore(Byte[], Int32, Int32) | Routes data written to the object into the hash algorithm for computing the HMAC. |
HashFinal() | Returns the computed Hash-based Message Authentication Code (HMAC) after all data has been written to the object. |
Initialize() | Initializes an instance of HMAC. |
Explicit Interface Implementations
Name | Description |
---|---|
IHashTransform.GetHash() | Gets the value of the computed hash code. |
IHashTransform.HashSize | Represents the size, in bits, of the computed hash code. |
IHashTransform.Process(Byte[], Int32, Int32) | Computes the hash value for the specified region of the input byte array. |
IHashTransform.Reset() | Resets the transform. |