I have a jks file which I need to put in Vault but before putting the jks file it should be base64 encoded and saved as json. This is the process in short -
encoding the jks to base64 --> Storing the string in a file --> Modify to json --> Store to vault
Here is what I am doing -
#encode and store it in a file
cat my-jks-file.jks | base64 > my-jks-file.txt
#Manually convert this to a json file which looks like this -
{
"my-secret" : <base64 string>
}
#Put this inside vault
vault kv put kv/foo @converted-jks-file.json
Is there a better way to do this? I want to avoid the manual step. Thanks