Constructor and Description |
---|
JceTlsHMAC(int cryptoHashAlgorithm,
javax.crypto.Mac hmac,
java.lang.String algorithm)
Base constructor.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
calculateMAC()
Return calculated MAC for any input passed in.
|
void |
calculateMAC(byte[] output,
int outOff)
Write the calculated MAC to an output buffer.
|
int |
getInternalBlockSize()
Return the internal block size for the message digest underlying this HMAC service.
|
int |
getMacLength()
Return the length of the MAC generated by this service.
|
void |
reset()
Reset the MAC underlying this service.
|
void |
setKey(byte[] key,
int keyOff,
int keyLen)
Set the key to be used by the MAC implementation supporting this service.
|
void |
update(byte[] input,
int inOff,
int length)
Update the MAC with the passed in input.
|
public JceTlsHMAC(int cryptoHashAlgorithm, javax.crypto.Mac hmac, java.lang.String algorithm)
cryptoHashAlgorithm
- the hash algorithm underlying the MAC implementationhmac
- MAC implementation.algorithm
- algorithm name to use for keys and to get the internal block size.public void setKey(byte[] key, int keyOff, int keyLen)
TlsMAC
public void update(byte[] input, int inOff, int length)
TlsMAC
public byte[] calculateMAC()
TlsMAC
calculateMAC
in interface TlsMAC
public void calculateMAC(byte[] output, int outOff)
TlsMAC
calculateMAC
in interface TlsMAC
output
- output array to write the MAC to.outOff
- offset into the output array to write the MAC to.public int getInternalBlockSize()
TlsHMAC
getInternalBlockSize
in interface TlsHMAC
public int getMacLength()
TlsMAC
getMacLength
in interface TlsMAC