Last active
May 21, 2017 10:49
-
-
Save 0neday/5cfe05da12c6bf5d4c9be9202b81b491 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| keytool -genkey -alias lyuap -keyalg RSA -keypass changeit -storepass changeit -keystore lyuap.keystore -keysize 2048 -validity 3600 | |
| keytool -export -alias lyuap -keystore lyuap.keystore -file lyuap.crt | |
| keytool -import -alias lyuap -file lyuap.crt -keystore cacerts | |
| 从jks导出私钥为pkcs12格式: | |
| keytool -importkeystore -srckeystore keystore.jks -destkeystore intermediate.p12 -deststoretype PKCS12 | |
| 转换pkcs12(pfx)为pem格式 | |
| openssl pkcs12 -in intermediate.p12 -out extracted.pem -nodes | |
| Export from keytool's proprietary format (called "JKS") to standardized format PKCS #12: | |
| keytool -importkeystore -srckeystore keystore.jks -destkeystore keystore.p12 | |
| -deststoretype PKCS12 -srcalias <jkskeyalias> -deststorepass <password> | |
| -destkeypass <password> | |
| Export certificate using openssl: | |
| openssl pkcs12 -in keystore.p12 -nokeys -out cert.pem | |
| Export unencrypted private key: | |
| openssl pkcs12 -in keystore.p12 -nodes -nocerts -out key.pem |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment