List of usage examples for org.springframework.vault.support VaultTransitContext builder
public static VaultTransitRequestBuilder builder()
From source file:example.encryption.VaultTransitOperationsIntegrationTest.java
/** * Encrypt and decrypt binary data with default encoding. *//*from w ww. j a v a2 s .c o m*/ @Test public void shouldEncryptAndDecryptBinaryData() { byte[] input = "That's just some random data. Move on, nothing to see here." .getBytes(StandardCharsets.UTF_8); String ciphertext = transitOperations.encrypt("foo-key", input, VaultTransitContext.builder().build()); log.info("Encrypted: {}" + ciphertext); byte[] plaintext = transitOperations.decrypt("foo-key", ciphertext, VaultTransitContext.builder().build()); assertThat(plaintext).hasSize(input.length).isEqualTo(plaintext); }