HMAC.calculate

Calculates the HMAC from the authentication key and the input data.

Discards the result of a previous hash calculation, invalidating and overwriting a previously returned result.

An error can be caused only by the parameters passed to the constructor. If this method does not throw, it is safe to assume it will never throw for the same set of constructor parameters.

The length of the returned hash is the return value of gcry_md_get_algo_dlen(algorithm) for the algorithm passed to the constructor of this class.

An empty key and/or empty input_data are tolerated.

class HMAC
ubyte[]
calculate
(
const(ubyte)[] key
,
const(ubyte)[][] input_data...
)

Parameters

key const(ubyte)[]

the HMAC key

input_data const(ubyte)[][]

the data to hash, which will be concatenated

Return Value

Type: ubyte[]

the resuting HMAC.

Throws

GcryptException on error.

Meta