Package com.aripd.util.security
Class CryptoUtils
- java.lang.Object
-
- com.aripd.util.security.CryptoUtils
-
public class CryptoUtils extends Object
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CryptoUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SecretKey
getAESKey(int keysize)
static SecretKey
getAESKeyFromPassword(char[] password, byte[] salt)
static byte[]
getRandomNonce(int numBytes)
static String
hex(byte[] bytes)
static String
hexWithBlockSize(byte[] bytes, int blockSize)
-
-
-
Method Detail
-
getRandomNonce
public static byte[] getRandomNonce(int numBytes)
-
getAESKey
public static SecretKey getAESKey(int keysize) throws NoSuchAlgorithmException
- Throws:
NoSuchAlgorithmException
-
getAESKeyFromPassword
public static SecretKey getAESKeyFromPassword(char[] password, byte[] salt) throws NoSuchAlgorithmException, InvalidKeySpecException
-
hex
public static String hex(byte[] bytes)
-
hexWithBlockSize
public static String hexWithBlockSize(byte[] bytes, int blockSize)
-
-