public class CryptoUtils
extends java.lang.Object
Constructor and Description |
---|
CryptoUtils() |
Modifier and Type | Method and Description |
---|---|
static javax.crypto.SecretKey |
getAESKey(int keysize) |
static javax.crypto.SecretKey |
getAESKeyFromPassword(char[] password,
byte[] salt) |
static byte[] |
getRandomNonce(int numBytes) |
static java.lang.String |
hex(byte[] bytes) |
static java.lang.String |
hexWithBlockSize(byte[] bytes,
int blockSize) |
public static byte[] getRandomNonce(int numBytes)
public static javax.crypto.SecretKey getAESKey(int keysize) throws java.security.NoSuchAlgorithmException
java.security.NoSuchAlgorithmException
public static javax.crypto.SecretKey getAESKeyFromPassword(char[] password, byte[] salt) throws java.security.NoSuchAlgorithmException, java.security.spec.InvalidKeySpecException
java.security.NoSuchAlgorithmException
java.security.spec.InvalidKeySpecException
public static java.lang.String hex(byte[] bytes)
public static java.lang.String hexWithBlockSize(byte[] bytes, int blockSize)