Reputation: 1332
I am trying to enable HTTPS traffic for my API service (using Dropwizard Java). However, I need to provide a keystore containing the SSL certificate for the Dropwizard configuration:
server:
applicationConnectors:
- type: https
port: 8443
keyStorePath: example.keystore
keyStorePassword: example
validateCerts: false
I have my .pfx certificate in a Key Vault in Azure, so I was wondering how I can also store a .jks keystore file in an Azure Key Vault?
I could alternatively just transfer the .jks keystore file directly to the virtual machine, but I am not sure if this would be very secure. How can I upload .jks files into Microsoft Azure Vault?
Upvotes: 2
Views: 4881
Reputation: 996
You can store a .jks (or any file) as a keyvault Secret if you base64 encode it and the total size is less then 25kb.
For example from the cli:
OUTPUT="$(base64 -w0 < test.txt)" & az keyvault secret set --name mysecret --vault-name myvault --value $OUTPUT
When retrieving the secret you can decode it and write the output to file.
Upvotes: 3