I am working on a application which is required to consume a Rest API which uses SSL mutual handshake. The Rest service provider has shared a certificate which even they are not sure is the correct one or not and further looking into this. I have looked into the web regarding SSL configuration and communication, however, practically I still have doubts.
I have read client should be using using the server certificate (public key) and their own private key to make requests. If my understanding is right following are my questions
How do I make my private key for this purpose? I tried using keytool to generate keystore, which by default creates a private key I think. Is this the right way?
Am I supposed to get a server certificate/public key?
If the answer to the above question is yes, then should I import that certificate to my keystore which I created and then use the keystore for communication?
Edit: I just want to put a little more details here. The application I am working in (Client) is already in production and also uses SSL. So, can I get the get the public key/certificate of my application by hitting the application the browser? I have found that the CA for my application as well the application hosting the rest api is same. I am just thinking if I really need to create a key pair and get it signed by a CA in my case or leverage any existing one?