Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Transit service doesn't work for anything other than engine Version 1 #234

Open
agupta-hw opened this issue Jan 15, 2021 · 0 comments

Comments

@agupta-hw
Copy link

agupta-hw commented Jan 15, 2021

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);
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant