be careful - Please use the OpenSSL tool to complete the following operations
- Suppose there is a keystore file in the current directory, named: keystore, and the password is: password
Converting from JKS to PKCS12 keytool -importkeystore -srckeystore keystore -destkeystore keystore_old.p12 -srcstoretype JKS -deststoretype PKCS12 -srcstorepass password -deststorepass password -srcalias server -destalias xxx -srckeypass password -destkeypass password -noprompt
Convert from PKCS12 to PEM format openssl pkcs12 -in keystore_old.p12 -out keystore_old.pem -passin pass:password -passout pass:password
Take out private key Open the PEM format file with Notepad, take the private key from the PEM format certificate chain, and save it as privateKey.key Generate private key openssl rsa -in privateKey.key -check The private key will be displayed on the command line interface |