public final class HMacGOST extends HMac
This class only instantiates the super HMac
class and specifies
GOST3411 as hash algorithm to be used.
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 GOST3411 hash algorithm, may be
initiated as follows:
Mac gostHMAC = Mac.getInstance("HMAC/GOST3411");
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:
gostHMAC.init(secret_key); byte[] mac_data = gostHMAC.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 |
---|
HMacGOST()
Default constructor.
|
engineDoFinal, engineGetMacLength, engineInit, engineReset, engineUpdate, engineUpdate
public HMacGOST() throws java.security.NoSuchAlgorithmException
HMac
class thereby specifying GOST3411 as hash function
to be used.java.security.NoSuchAlgorithmException
- if there is no implementation for GOST3411