I have a public certificate from a CA. I want to create a Java SSL connection using this certificate. I referred How can I use different certificates on specific connections
You can use keyStore explorer gui tool to generate keystore/certificate and for importing/exporting certificate into keystore.