RealKeyManager implements KeyManager { @Override public byte[] encryptDeterministically(byte[] plaintext) throws NigoriCryptographyException { return encrypt(encryptionSecretKey, plaintext, false); } RealKeyManager(String serverName, byte[] username, byte[] password);  RealKeyManager(String serverName); @Override byte[] getUsername(); @Override byte[] getPassword(); @Override String getServerName(); @Override byte[] decrypt(byte[] ciphertext); @Override byte[] decrypt(byte[] encryptionKey, byte[] ciphertext); @Override byte[] encrypt(byte[] plaintext); @Override byte[] encrypt(byte[] key, byte[] plaintext); @Override byte[] encryptDeterministically(byte[] plaintext); @Override byte[] encryptDeterministically(byte[] key, byte[] plaintext); @Override DSASign signer(); void destroy(); @Override void finalize();  }
@Test public void encryptDeterministically() throws NigoriCryptographyException { for (EncryptionTestCase testCase : detEncryptionTestCases) { assertArrayEquals(testCase.answer, testCase.keyManager.encryptDeterministically(testCase.plaintext)); } }