The .jks
file is the Java Keystore. It should contain the correct client certificates (and maybe also the intermediate certificates from the certificate chain).
I assume you are going to write a client that uploads the file to the HTTPS server? Then you should use the .jks
file with the client certificate with the (let's say apache) HttpClient
.
You need to create a SSLContext
and load the keystore
SSLContext sslcontext = SSLContexts.custom().loadTrustMaterial(new File("keystore", "yourPassword".toCharArray(), new TrustSelfSignedStrategy()).build();
Then you have to put the sslContext
in a SSLConnectionSocketFactory
SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslcontext, new String[] { "TLSv1" }, null, SSLConnectionSocketFactory.getDefaultHostnameVerifier());
And then finally build the HttpClient
HttpClient httpclient = HttpClients.custom().setSSLSocketFactory(sslsf).build();
After all these steps the httpClient should use your client certificate from the keystore for your desired request.