Rebex
Products Downloads Buy Support Contact
Show / Hide Table of Contents

HMAC Class

Namespace: Rebex.Security.Cryptography
Assembly: Rebex.Common.dll (version 7.0.9147)

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
Inheritance
Object
HashAlgorithm
KeyedHashAlgorithm
HMAC
Implements
ICryptoTransform
IHashTransform
IDisposable
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
HashAlgorithm.CanReuseTransform
HashAlgorithm.CanTransformMultipleBlocks
HashAlgorithm.Clear()
HashAlgorithm.ComputeHash(Byte[])
HashAlgorithm.ComputeHash(Byte[], Int32, Int32)
HashAlgorithm.ComputeHash(Stream)
HashAlgorithm.ComputeHashAsync(Stream, CancellationToken)
HashAlgorithm.Dispose()
HashAlgorithm.Hash
HashAlgorithm.HashCore(ReadOnlySpan<Byte>)
HashAlgorithm.HashSize
HashAlgorithm.HashSizeValue
HashAlgorithm.HashValue
HashAlgorithm.InputBlockSize
HashAlgorithm.OutputBlockSize
HashAlgorithm.State
HashAlgorithm.TransformBlock(Byte[], Int32, Int32, Byte[], Int32)
HashAlgorithm.TransformFinalBlock(Byte[], Int32, Int32)
HashAlgorithm.TryComputeHash(ReadOnlySpan<Byte>, Span<Byte>, Int32)
HashAlgorithm.TryHashFinal(Span<Byte>, Int32)
KeyedHashAlgorithm.Create()
KeyedHashAlgorithm.Create(String)
KeyedHashAlgorithm.KeyValue

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.

In This Article
  • Remarks
  • Constructors
  • Properties
  • Methods
  • Explicit Interface Implementations
© REBEX ČR s.r.o. Back to top
Privacy policy
Manage cookies