public static Cipher newCipher(PrivateKey privateKey) throws Exception { Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); cipher.init(Cipher.DECRYPT_MODE, privateKey); return cipher; }
private static Cipher newCipher(SecretKey symmetricKey, IvParameterSpec iv) throws Exception { Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); cipher.init(Cipher.DECRYPT_MODE, symmetricKey, iv); return cipher; }