[SSL] Create Java keystore from certificate and key

To create a Java keystore file from a certificate and key pair files, you can use the openssl and keytool commands.

First, convert the certificate to PKCS12 format:

openssl pkcs12 -export -in mycertificate.crt -inkey mykey.key -out mycertificate.p12

then create the keystore:

keytool -importkeystore -srckeystore mycertificate.p12 -srcstoretype PKCS12 -destkeystore mycertificate.jks -deststoretype JKS

No comments:

Post a Comment

With great power comes great responsibility.

Da grandi poteri derivano grandi responsabilità.