Few basic steps to create a complete keystore to host a server certificate. Create your custom self-signed CA if not yet available a trusted one # openssl genrsa -des3 -out ca.key 1024 # openssl req -new -x509 -day
Few basic steps to create a complete keystore to host a server SSL certificate.
openssl genrsa -des3 -out ca.key 1024
openssl req -new -x509 -days 3650 -key ca.key -out ca.cer -config openssl.cnf
keytool -genkey -alias server -dname "CN=www.tirasa.net, OU=ITC, O=Tirasa, L=Pescara, ST=Italy, C=IT" -storepass password -keystore keystore -keyalg RSA -keypass password
keytool -import -alias ca -file ca.cer -keypass password -keystore keystore -storepass password
keytool -certreq -alias server -keyalg RSA -file tirasa.req -keypass password -keystore keystore -storepass password
openssl ca -config openssl.cnf -days 3650 -cert ca.cer -keyfile ca.key -out tirasa.pem -infiles tirasa.req
-----BEGIN CERTIFICATE-----
MIIDHzCCAoigAwIBAgIBEjANBgkqhkiG9w0BAQQFADBfMQswCQYDVQQGEwJJVDEO
........
-----END CERTIFICATE-----
openssl x509 -in tirasa.pem -outform DER -out tirasa.der
keytool -import -alias server -file tirasa.der -keypass password -keystore keystore -storepass password