Created
April 21, 2017 20:44
-
-
Save albertoaflores/9f569208152e745061b36130c44f2f57 to your computer and use it in GitHub Desktop.
Creates a key using JDK's keytool. It's used to encrypt/decrypt values.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALIAS_NAME="mytestkey" | |
KEYSTORE_SECRET="changeme" | |
KEYSTORE_PASSWORD="letmein" | |
VALIDITY_TIME=365 | |
echo "Creating server key, valid for $VALIDITY_TIME days" | |
keytool -genkeypair -alias $ALIAS_NAME -keyalg RSA \ | |
-dname "CN=Web Server,OU=Unit,O=Organization,L=City,S=State,C=US" \ | |
-keypass $KEYSTORE_SECRET -keystore server.jks -storepass $KEYSTORE_PASSWORD \ | |
-validity $VALIDITY_TIME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment