Package com.mku.integrity
Class HmacSHA256Provider
java.lang.Object
com.mku.integrity.HmacSHA256Provider
- All Implemented Interfaces:
IHashProvider
Provides HMAC SHA-256 hashing.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
calc
(byte[] hashKey, byte[] buffer, int offset, int count) Calculate HMAC SHA256 hash for a byte buffer.
-
Constructor Details
-
HmacSHA256Provider
public HmacSHA256Provider()
-
-
Method Details
-
calc
public byte[] calc(byte[] hashKey, byte[] buffer, int offset, int count) Calculate HMAC SHA256 hash for a byte buffer.- Specified by:
calc
in interfaceIHashProvider
- Parameters:
hashKey
- The HMAC SHA256 key to use for hashing (32 bytes).buffer
- The buffer to read the data from.offset
- The position reading will start from.count
- The count of bytes to be read.- Returns:
- The HMAC SHA256 hash.
- Throws:
IntegrityException
- thrown if hash cannot be calculated
-