ifHMAC

Implemented by

NameDescription
roHMACThe HMAC component provides an interface to the OpenSSL HMAC functions

Supported methods

Setup(digestType as String, key as Object) as Integer

Description

Initializes new HMAC context.

Parameters

NameTypeDescription
digestTypeStringSelects one of the supported digest algorithms, as documented in roEVPDigest.
keyObjectAn roByteArray containing the key for the MAC.

Return Value

An integer indicating whether the function succeeded (0) or failed (1).

Reinit() as Integer

Description

Re-initializes an existing HMAC context. This can be called to reuse an existing roHMAC object to authenticate new data.

Return Value

An integer indicating whether the function succeeded (0) or failed (1).

Process(message as Object) as Object

Description

Digests the data in an array generates a MAC. Calling this method is the same as making the following calls:

hmac.Reinit()
hmac.Update(message)
mac = hmac.Final()

Parameters

NameTypeDescription
messageObjectAn roByteArray with the data to be digested.

Return Value

An roByteArray containing the generated MAC.

Update(partialMesssage as Object) as Void

Description

Adds more data to be digested. The data in the array is added to the current digest.

Parameters

NameTypeDescription
partialMesssageObjectAn roByteArray with the additional data to be digested.

Final() as Object

Description

Returns an roByteArray containing the final MAC.

Return Value

The final MAC.