类 HashCrypto


  • public class HashCrypto
    extends Object
    Provides hash crypto operations
    • 构造器详细资料

      • HashCrypto

        public HashCrypto()
    • 方法详细资料

      • hmacSha256

        public static byte[] hmacSha256​(byte[] data,
                                        byte[] keyBytes)
                                 throws Exception
        HMAC_SHA56 hash function
        参数:
        data - specified message data in byte array
        keyBytes - specified key in byte array
        返回:
        hash data in byte array
        抛出:
        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.
        参数:
        password - specified password in byte array
        salt - specified salt in byte array
        iteration - iteration counter
        返回:
        derived key in byte array