@Test public void testSerializableEncrypted() throws Exception { OpenSSLKey key = new BouncyCastleOpenSSLKey(file.getAbsoluteFilename()); key.encrypt("too many secrets"); OpenSSLKey copy = serialiseAndDeserialise(key); assertThat(copy, equalTo(key)); }
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();  }