Class Crypto.Utils
java.lang.Object
com.almis.awe.model.util.security.Crypto.Utils
- Enclosing class:
- Crypto
Utils
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
encodeHex
(byte[] hash) Returns an hexadecimal string from a byte arraystatic byte[]
getRandomBytes
(int len) Retrieve random bytesstatic int
Get the recommended iteration numberstatic String
Encode with pbkdf
-
Method Details
-
pbkdf2
public static String pbkdf2(String password, String salt, int iterationCount, int dkLen) throws InvalidKeyException, NoSuchAlgorithmException Encode with pbkdf- Parameters:
password
- passwordsalt
- saltiterationCount
- iteration countdkLen
- dk length- Returns:
- encoded key
- Throws:
InvalidKeyException
- Invalid key exceptionNoSuchAlgorithmException
- 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
Returns an hexadecimal string from a byte array- Parameters:
hash
- Hash- Returns:
- String
-