Package com.mku.salmon.integrity
Class HMACSHA256Provider
- java.lang.Object
-
- com.mku.salmon.integrity.HMACSHA256Provider
-
- All Implemented Interfaces:
IHashProvider
public class HMACSHA256Provider extends java.lang.Object implements IHashProvider
Provides HMAC SHA-256 hashing.
-
-
Constructor Summary
Constructors Constructor Description HMACSHA256Provider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
calc(byte[] hashKey, byte[] buffer, int offset, int count)
Calculate HMAC SHA256 hash for a byte buffer.
-
-
-
Method Detail
-
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
-
-