Skip to content

Instantly share code, notes, and snippets.

@stoyicker
Created January 2, 2016 16:12
Show Gist options
  • Save stoyicker/45f2aaa72eb430c5b0e5 to your computer and use it in GitHub Desktop.
Save stoyicker/45f2aaa72eb430c5b0e5 to your computer and use it in GitHub Desktop.
Generating a keystore
if [ "$#" -ne 3 ]; then
echo "Usage: $0 aliasName desiredKeystorePassword desiredKeyPassword" >&2
exit 1
fi
keytool -genkey -v -keystore $1.keystore -alias $1 -keyalg RSA -keysize 2048 -validity 10000 -storepass $2 -keypass $3
echo $2 > keystore.pwd
echo $3 > key.pwd
echo "storeFile new File(\"$1.keystore\")
storePassword(new File(\"keystore.pwd\").text.trim())
keyAlias(\"$1\")
keyPassword(new File(\"key.pwd\").text.trim())"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment