Ejemplo n.º 1
0
 public static Cipher newCipher(PrivateKey privateKey) throws Exception {
   Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);
   cipher.init(Cipher.DECRYPT_MODE, privateKey);
   return cipher;
 }
Ejemplo n.º 2
0
 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;
 }