Class Crypto.Utils

java.lang.Object
com.almis.awe.model.util.security.Crypto.Utils
Enclosing class:
Crypto

public static class Crypto.Utils extends Object
Utils
  • Method Details

    • pbkdf2

      public static String pbkdf2(String password, String salt, int iterationCount, int dkLen) throws InvalidKeyException, NoSuchAlgorithmException
      Encode with pbkdf
      Parameters:
      password - password
      salt - salt
      iterationCount - iteration count
      dkLen - dk length
      Returns:
      encoded key
      Throws:
      InvalidKeyException - Invalid key exception
      NoSuchAlgorithmException - No such algorithm exception
    • getRandomBytes

      public static byte[] getRandomBytes(int len)
      Retrieve random bytes
      Parameters:
      len - Length
      Returns:
      random bytes
    • getRecommendedIterationNumber

      public static int getRecommendedIterationNumber()
      Get the recommended iteration number
      Returns:
      String
    • encodeHex

      public static String encodeHex(byte[] hash)
      Returns an hexadecimal string from a byte array
      Parameters:
      hash - Hash
      Returns:
      String