You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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);
}
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: