Class HMACHashUtilities
java.lang.Object
io.getlime.security.powerauth.crypto.lib.util.HMACHashUtilities
Simple utility class for HMAC-SHA256 algorithm
- Author:
- Petr Dvorak, petr@wultra.com
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
HMACHashUtilities
public HMACHashUtilities()
-
-
Method Details
-
hash
Compute a HMAC-SHA256 of given data with provided key bytes- Parameters:
key- Key for the HMAC-SHA256 algorithmdata- Data for the HMAC-SHA256 algorithm.- Returns:
- HMAC-SHA256 of given data using given key.
- Throws:
GenericCryptoException- In case hash computation fails.CryptoProviderException- In case cryptography provider is incorrectly initialized.
-
hash
public byte[] hash(SecretKey hmacKey, byte[] data) throws GenericCryptoException, CryptoProviderException Compute a HMAC-SHA256 of given data with provided key bytes- Parameters:
hmacKey- Key for the HMAC-SHA256 algorithmdata- Data for the HMAC-SHA256 algorithm.- Returns:
- HMAC-SHA256 of given data using given key.
- Throws:
GenericCryptoException- In case hash computation fails.CryptoProviderException- In case cryptography provider is incorrectly initialized.
-