CipherCodec implements Codec { @Override public String decode(String value) throws SQLException { try { Cipher cipher = Cipher.getInstance(this.key.getAlgorithm()); cipher.init(Cipher.DECRYPT_MODE, this.key); return new String(cipher.doFinal(Base64.getDecoder().decode(value))); } catch (GeneralSecurityException e) { throw new SQLException(e); } } CipherCodec(Key key); Key getKey(); @Override String decode(String value); @Override String encode(String value);  }
@Test public void decode() throws SQLException { Assert.assertEquals(PASSWORD, this.codec.decode(ENCODED)); }