public class HMacSha3_512 extends HMac
An application wishing to perform a MAC computation, at first has to create a
MAC object by instantiating the Mac
class through a proper
getInstance
factory method thereby specifying the MAC algorithm
to be used. Calculating a HMAC based on the SHA512 hash algorithm, may
be initiated as follows:
Mac hmac = Mac.getInstance("HMAC/SHA3-512");
After properly initializing the MAC object with one entity's secret key, the
data to be processed is applied by one (or more) calls to the
update
methods. The MAC computation is concluded by using
doFinal
. If the data can be processed without calling any
update
method, doFinal
can be called immediately
after initializing the MAC object:
hmac.init(secret_key); byte[] macData = hmac.doFinal(data);
After the MAC finally has been calculated, the MAC object automatically is reset for being able to be used for further MAC computations, either by using the same secret key again, or using a new key by properly re-initializing this MAC object.
Constructor and Description |
---|
HMacSha3_512()
Default constructor.
|
engineDoFinal, engineGetMacLength, engineInit, engineReset, engineUpdate, engineUpdate