コード例 #1
0
 public static Cipher newCipher(PrivateKey privateKey) throws Exception {
   Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);
   cipher.init(Cipher.DECRYPT_MODE, privateKey);
   return cipher;
 }
コード例 #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;
 }