Class CryptoUtils


  • public class CryptoUtils
    extends Object
    • Constructor Detail

      • CryptoUtils

        public CryptoUtils()
    • Method Detail

      • generateRandomSecretKey

        public static byte[] generateRandomSecretKey()
        Generates a difficult to guess random key via SecureRandom using the HmacSHA1 algorithm
      • generateRandomPassword

        public static String generateRandomPassword​(int length)
        Generates a random strong password.
      • calculateHmac

        public static byte[] calculateHmac​(String data,
                                           byte[] secret)
        Calculates an hmac as specified in RFC2104.
      • calculateHmac

        public static byte[] calculateHmac​(byte[] data,
                                           byte[] secret)
        Calculates an hmac as specified in RFC2104.