Note: will only work on Mac and Linux
openssl pkcs12 -export -in host.crt -inkey host.key > host.p12
keytool -importkeystore -srckeystore host.p12 -destkeystore keycloak.jks -srcstoretype pkcs12
###Sample output:
$ openssl pkcs12 -export -in host.crt -inkey host.key > host.p12 Enter pass phrase for host.key: Enter Export Password: Verifying - Enter Export Password:
$ keytool -importkeystore -srckeystore host.p12 -destkeystore host.jks -srcstoretype pkcs12 Enter destination keystore password: Re-enter new password: Enter source keystore password: Entry for alias 1 successfully imported. Import command completed: 1 entries successfully imported, 0 entries failed or cancelled