Last active
October 29, 2018 04:17
-
-
Save sunb0002/93cec26875ed1a7bb749671bb257ffbb to your computer and use it in GitHub Desktop.
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
## Generate a keypair | |
openssl req -x509 -newkey rsa:2048 -sha256 -keyout example.key -out example.crt -subj "/CN=example.com" -days 3650 | |
## Create PFX keystore with this keypair | |
openssl pkcs12 -inkey example.key -in example.crt -export -out keystore.pkcs12 | |
## Convert PFX keystore into Java JKS keystore | |
keytool -importkeystore -srckeystore keys.pkcs12 -srcstoretype pkcs12 -destkeystore keystore.jks | |
## Other often used | |
keytool -list -v -keystore keystore.jks -alias mydomain | |
keytool -delete -alias mydomain -keystore keystore.jks | |
keytool -import -alias csl -keystore keystore.jks -file csl.crt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment