Hi, I am trying to use this Vault Client to do encrypt/decrypt with Vault and having issues.
Sample code below, when using
final Vault vault = new Vault(config) does not work. Nothing is wrong in config as the health check passes and just specifying the version explicitly to 1 works fine. Is this intentional?
try {
final Vault vault = new Vault(config, 1);
String base64EncodedString = Base64.getEncoder().encodeToString(plainText.getBytes(StandardCharsets.UTF_8));
LogicalResponse response =
vault.logical().write("transit/encrypt/" + keyName, Collections.singletonMap("plaintext", base64EncodedString));
//TODO For Initial Debugging/Dev
logger.info("CipherText: {}", response.getDataObject().get("ciphertext"));
} catch (VaultException e) {
throw new RuntimeException("Could not encrypt for key " + key);
}