@Test public void testEncryptionAndDecryption() { KeyCrypterECDH aliceKeyExchangeCrypter = new KeyCrypterECDH(); KeyParameter aliceKeyParameter = aliceKeyExchangeCrypter.deriveKey(aliceKey, bobKey); EncryptedData encryptedData = aliceKeyExchangeCrypter.encrypt(secret.getBytes(), aliceKeyParameter); assertNotNull(encryptedData); KeyCrypterECDH bobKeyExchangeCrypter = new KeyCrypterECDH(); KeyParameter bobKeyParameter = bobKeyExchangeCrypter.deriveKey(bobKey, aliceKey); byte [] decryptedData = bobKeyExchangeCrypter.decrypt(encryptedData, bobKeyParameter); assertNotNull(decryptedData); assertEquals("they should be the same string", new String(decryptedData), secret ); }
@Override public KeyParameter deriveKey(CharSequence password) throws KeyCrypterException { throw new UnsupportedOperationException("use deriveKey(ECKey, ECKey) instead"); }
KeyCrypterECDH extends KeyCrypterAESCBC { @Override public KeyParameter deriveKey(CharSequence password) throws KeyCrypterException { throw new UnsupportedOperationException("use deriveKey(ECKey, ECKey) instead"); } }
KeyCrypterECDH extends KeyCrypterAESCBC { @Override public KeyParameter deriveKey(CharSequence password) throws KeyCrypterException { throw new UnsupportedOperationException("use deriveKey(ECKey, ECKey) instead"); }  }
KeyCrypterECDH extends KeyCrypterAESCBC { @Override public KeyParameter deriveKey(CharSequence password) throws KeyCrypterException { throw new UnsupportedOperationException("use deriveKey(ECKey, ECKey) instead"); }  @Override KeyParameter deriveKey(CharSequence password); KeyParameter deriveKey(ECKey secretKey, ECKey publicKey); @Override EncryptionType getUnderstoodEncryptionType(); @Override String toString(); }
KeyCrypterECDH extends KeyCrypterAESCBC { @Override public KeyParameter deriveKey(CharSequence password) throws KeyCrypterException { throw new UnsupportedOperationException("use deriveKey(ECKey, ECKey) instead"); }  @Override KeyParameter deriveKey(CharSequence password); KeyParameter deriveKey(ECKey secretKey, ECKey publicKey); @Override EncryptionType getUnderstoodEncryptionType(); @Override String toString();  }