@Test public void decrypt() throws Exception { final byte[] bytes = new byte[100]; final SecureRandom secureRandom = new SecureRandom(); for (int i = 0; i < 100; i++) { final byte[] keys = new byte[16]; secureRandom.nextBytes(keys); secureRandom.nextBytes(bytes); final byte[] actual = Decryptor.create(keys).decrypt(Encryptor.create(keys).encrypt(bytes)); assertTrue(Arrays.equals(actual, bytes)); } }
public byte[] decrypt(final byte[] rawData) throws GeneralSecurityException { if (rawData == null) { return null; } return decryptCipher.doFinal(rawData); }
Decryptor { public byte[] decrypt(final byte[] rawData) throws GeneralSecurityException { if (rawData == null) { return null; } return decryptCipher.doFinal(rawData); } }
Decryptor { public byte[] decrypt(final byte[] rawData) throws GeneralSecurityException { if (rawData == null) { return null; } return decryptCipher.doFinal(rawData); } private  Decryptor(final byte[] rawKeyData,
      final String algorithm,
      final IvParameterSpec ivParameterSpec); }
Decryptor { public byte[] decrypt(final byte[] rawData) throws GeneralSecurityException { if (rawData == null) { return null; } return decryptCipher.doFinal(rawData); } private  Decryptor(final byte[] rawKeyData,
      final String algorithm,
      final IvParameterSpec ivParameterSpec); static Decryptor create(final byte[] key); static Decryptor create(final byte[] key, final byte[] iv); byte[] decrypt(final byte[] rawData); String decrypt(final String rawData); void decryptInto(final ByteBuffer input, final ByteBuffer output); int estimateByteSize(final int inputByteSize); void resetIvParameter(final byte[] iv, final int offset); }
Decryptor { public byte[] decrypt(final byte[] rawData) throws GeneralSecurityException { if (rawData == null) { return null; } return decryptCipher.doFinal(rawData); } private  Decryptor(final byte[] rawKeyData,
      final String algorithm,
      final IvParameterSpec ivParameterSpec); static Decryptor create(final byte[] key); static Decryptor create(final byte[] key, final byte[] iv); byte[] decrypt(final byte[] rawData); String decrypt(final String rawData); void decryptInto(final ByteBuffer input, final ByteBuffer output); int estimateByteSize(final int inputByteSize); void resetIvParameter(final byte[] iv, final int offset);  }