Skip to content

Instantly share code, notes, and snippets.

@p-karanthaker
Last active October 7, 2020 10:19
Show Gist options
  • Save p-karanthaker/0878c227e9b02aa70eda36ead330ab26 to your computer and use it in GitHub Desktop.
Save p-karanthaker/0878c227e9b02aa70eda36ead330ab26 to your computer and use it in GitHub Desktop.
Base64 encode an entire keystore to store within Hashicorp Vault kv store
Creating a keystore with a keypair:
keytool -genkeypair -alias boguscert -storepass storePassword -keypass secretPassword -keystore emptyStore.keystore -dname "CN=Developer, OU=Department, L=City, ST=State, C=CA"
Deleting a keypair to make an empty keystore:
keytool -delete -alias boguscert -storepass storePassword -keystore emptyStore.keystore
Listing the keystore:
keytool -list -keystore emptyStore.keystore -storepass storePassword
Base64 encode the keystore (this can be stored within Vault):
openssl base64 -in emptyStore.keystore -out base64.keystore
Decode the keystore (for use outside of vault):
openssl base64 -d -in base64.keystore -out decoded.keystore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment