However, there are some points that I don’t understand :
In the first step, we create a keystore than generate a csr from that and receive the ssl cert from CA.
I’m wondering if the private key is the certificate into that keystore ?
Otherwise, where is the private key ?
In the fifth Step, we replace the server-cert which is created in first step with CA signed certificate.
Is it normal that we overwrite this certificate ?
It would be great if you could help me out.
Thank you in advance
The keytool -genkey (aka keytool -genkeypair) command generates a public-private key pair in the specified keystore.
You then use the keytool -certreq command to generate a certificate signing request (CSR) for the public key certificate.
When you get the signed certificate response from the CA, that is the certificate to import into the keystore where you ran the keytool -certreq command. The server will then present this certificate when negotiating secure connections. The original certificate is self-signed. The certificate you got in the response was signed by a CA, so peers will hopefully recognize it when the server presents it to negotiate a secure connection.