EncryptedValue { @JsonIgnore public abstract String decrypt(KeyWithType kwa);  @JsonIgnore abstract T accept(EncryptedValueVisitor<T> visitor); @JsonIgnore abstract String decrypt(KeyWithType kwa); static boolean isEncryptedValue(String value); static EncryptedValue fromString(String value); @Override final String toString();  }
@Test public void weCanDecryptValueEncryptedUsingExistingRsaKey() { EncryptedValue encryptedValue = Algorithm.RSA.newEncrypter().encrypt(rsaPubKey, plaintext); assertThat(encryptedValue.decrypt(rsaPrivKey), is(plaintext)); }