Don't try to catch exceptions that'll never be thrown

This commit is contained in:
Alexander Bakker 2018-06-05 15:49:00 +02:00
parent 66ea357f08
commit 964fc72fba
5 changed files with 15 additions and 28 deletions

View file

@ -39,8 +39,7 @@ public class CryptoUtils {
public static final int CRYPTO_SCRYPT_r = 8;
public static final int CRYPTO_SCRYPT_p = 1;
public static SecretKey deriveKey(char[] password, byte[] salt, int n, int r, int p)
throws NoSuchAlgorithmException, InvalidKeySpecException {
public static SecretKey deriveKey(char[] password, byte[] salt, int n, int r, int p) {
byte[] bytes = toBytes(password);
byte[] keyBytes = SCrypt.generate(bytes, salt, n, r, p, CRYPTO_KEY_SIZE);
return new SecretKeySpec(keyBytes, 0, keyBytes.length, "AES");