loading...

Convert a keystore file (.jks) into a PEM certificate

groguelon profile image Geoffrey Roguelon ・1 min read
# Export the certificate
keytool -export -alias mydomain -file mydomain.der -keystore mycert.jks
# Convert the certificate into PEM
openssl x509 -inform der -in mydomain.der -out mydomain.pem
# Export the key
keytool -importkeystore -srckeystore mycert.jks -destkeystore keystore.p12 -deststoretype PKCS12
# concert PKCS12 key to unencrypted PEM
openssl pkcs12 -in keystore.p12  -nodes -nocerts -out mydomain.key

Source

Discussion

pic
Editor guide