I am new to configure Jetty Server for SSL. I followed steps from digcert I created private key file, Certificate Request CSR file.
I sent Certificate Request to CA and got my signed CSR back. But CA sent me a bundle with two certificates, one is my certificate signed by CA and second is CA Certificate.(1. star_xyx_abc_com crt file, 2.DigiCertCA crt file). Now I am facing trouble to create a keystore from these files.
When I used keytool to create keystore by following Oracle docs steps 4,5 and 6, I got an error
keytool error: java.lang.Exception: Certificate not imported, alias already exists.
when I used openssl to create pkcs12 I got
Loading 'screen' into random state - done
Error unable to get issuer certificate getting chain.
error.
How can I generate KeyStore from private key file, my certificate signed by CA and CA Certificate ?
Here the steps I followed to install the certificate.
1.Created a PKCS12 with three files(private key file, my cert, CA cert) using OPENSSL tool.
openssl pkcs12 -export -out j2vproject.pkcs12 -inkey my_privatekeyfile.key -in star_xyz_abc.crt -certfile DigiCertCA.crt
2.Created a java keystore from PKCS12 using Keytool tool.
keytool -v -importkeystore -srckeystore j2vproject.pkcs12 -srcstoretype PKCS12 -destkeystore j2vprojectkeystore.jks -deststoretype JKS
3.added this keystore to server and it worked.