Convert jks and get public and private keys out:
keytool -importkeystore -srckeystore default.keystore -destkeystore new-store.p12 -deststoretype PKCS12
- Gives new-store.p12
openssl pkcs12 -in new-store.p12 -nokeys -out public.pem
- Gives public key as public.pem
openssl pkcs12 -in new-store.p12 -nodes -nocerts -out private.pem
- Gives private key as private.pem
Export jks public key as a pem file
keytool -exportcert -alias selfsigned -keypass password -keystore test-user.jks -rfc -file test-user.pem