Encrypting data from the Hashicorp Vault aes256-gcm96 by exported key

Hi Vault Community,

I am trying to encrypt the data outside of vault. I am aware there is a way to do using data key from vault. But What I am doing can be broken down into the below steps.

  1. Export key from the vault
  2. Use the key to encrypt/decrypt the data.

Now the problem is my golang code is complaining the key is 44 byte. It is expecting it to be 32 bytes.
On using 32 characters from the key it works. Can someone help what is the issue and I am doing wrong.

Thanks in Advance.

Based on the sample response in the API docs it looks like the keys are base64 encoded. You may need to decode them before use in your code.

Already doing so, but not working