com.baidubce.services.iothisk.device.crypto
Class HashCrypto
java.lang.Object
com.baidubce.services.iothisk.device.crypto.HashCrypto
public class HashCrypto
- extends Object
Provides hash crypto operations
|
Method Summary |
static byte[] |
hmacSha256(byte[] data,
byte[] keyBytes)
HMAC_SHA56 hash function |
static byte[] |
pbkdf2WithHmacSha256(byte[] password,
byte[] salt,
int iteration)
PBKDF2(Password-Based Key Derivation Function) with hmac sha256 key derivation function. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HashCrypto
public HashCrypto()
hmacSha256
public static byte[] hmacSha256(byte[] data,
byte[] keyBytes)
throws Exception
- HMAC_SHA56 hash function
- Parameters:
data - specified message data in byte arraykeyBytes - specified key in byte array
- Returns:
- hash data in byte array
- Throws:
Exception - NoSuchAlgorithmException, InvalidKeyException, IllegalStateException, IllegalArgumentException
pbkdf2WithHmacSha256
public static byte[] pbkdf2WithHmacSha256(byte[] password,
byte[] salt,
int iteration)
- PBKDF2(Password-Based Key Derivation Function) with hmac sha256 key derivation function.
- Parameters:
password - specified password in byte arraysalt - specified salt in byte arrayiteration - iteration counter
- Returns:
- derived key in byte array
Copyright © 2020. All rights reserved.