Skip to content

Instantly share code, notes, and snippets.

@tague
Created Jun 8, 2018
Embed
What would you like to do?
Convert Redis Enterprise Cloud credentials to key/truststore
#!/bin/bash
echo -n "store password: "
read -s storepass
echo ""
## Create Truststore from PEM file
keytool -import -noprompt -trustcacerts -alias redislabs-ca -file redislabs_ca.pem -keystore redislabs_truststore.p12 -storepass $storepass -storetype PKCS12
keytool -list -keystore redislabs_truststore.p12 -storepass $storepass
## Create Keystore from certificate and private key
openssl pkcs12 -export -in redislabs_user.crt -inkey redislabs_user_private.key -out redisclient.p12 -passout pass:$storepass
keytool -importkeystore -noprompt -srckeystore redisclient.p12 -srcstoretype PKCS12 -srcstorepass $storepass -destkeystore redisclient_keystore.p12 -deststoretype PKCS12 -storepass $storepass
rm redisclient.p12
keytool -list -keystore redislabs_truststore.p12 -storepass $storepass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment