title: How to import a jks certificate in java trust store
body: <p>How do I import a .jks file into the java security's truststore? All the tutorial I'm seeing is using a ".crt" file. However, I only have the ".jks" file which is also the keystore I generated using the keytool command.</p>
  
  <p>Currently, I'm following <a href="http://www.sslshopper.com/article-most-common-java-keytool-keystore-commands.html" rel="nofollow noreferrer">this tutorial</a>.</p>
  
  <p>I was able to generate a Java keystore and key pair and generate a certificate signing request (CSR) for an existing Java keystore, which is based on the tutorial. But I cannot import a root or intermediate CA certificate to an existing Java keystore, and import a signed primary certificate to an existing Java keystore, because it is looking for a ".cert" file.</p>
  
  <p>Am I missing something on the steps listed on the tutorial? How can I trust a certificate if the only file I have is the ".jks" file? And what is the use of the ".csr" file?</p>
  
  <p>Please note that I'm using Windows.</p>