@Test public void testEqualsForKeysDifferingByEncrypted() throws Exception { OpenSSLKey key1 = new BouncyCastleOpenSSLKey(file.getAbsoluteFilename()); OpenSSLKey key2 = new BouncyCastleOpenSSLKey(file.getAbsoluteFilename()); key2.encrypt("too many secrets"); assertThat(key2, not(equalTo(key1))); }
public void encrypt(String password) throws GeneralSecurityException { encrypt(password.getBytes()); }
OpenSSLKey implements Serializable { public void encrypt(String password) throws GeneralSecurityException { encrypt(password.getBytes()); } }
OpenSSLKey implements Serializable { public void encrypt(String password) throws GeneralSecurityException { encrypt(password.getBytes()); } OpenSSLKey(InputStream is);  OpenSSLKey(String file);  OpenSSLKey(PrivateKey key);  OpenSSLKey(String algorithm, byte[] data); }
OpenSSLKey implements Serializable { public void encrypt(String password) throws GeneralSecurityException { encrypt(password.getBytes()); } OpenSSLKey(InputStream is);  OpenSSLKey(String file);  OpenSSLKey(PrivateKey key);  OpenSSLKey(String algorithm, byte[] data); boolean isEncrypted(); void decrypt(String password); void decrypt(byte[] password); void encrypt(String password); void encrypt(byte[] password); void setEncryptionAlgorithm(String alg); PrivateKey getPrivateKey(); void writeTo(OutputStream output); void writeTo(Writer w); void writeTo(String file); @Override boolean equals(Object other); @Override int hashCode(); }
OpenSSLKey implements Serializable { public void encrypt(String password) throws GeneralSecurityException { encrypt(password.getBytes()); } OpenSSLKey(InputStream is);  OpenSSLKey(String file);  OpenSSLKey(PrivateKey key);  OpenSSLKey(String algorithm, byte[] data); boolean isEncrypted(); void decrypt(String password); void decrypt(byte[] password); void encrypt(String password); void encrypt(byte[] password); void setEncryptionAlgorithm(String alg); PrivateKey getPrivateKey(); void writeTo(OutputStream output); void writeTo(Writer w); void writeTo(String file); @Override boolean equals(Object other); @Override int hashCode();  }