title: NoSuchAlgorithmException: der KeyStore not available
body: <p>I am trying to do a <code>POST</code> call to a secure website:</p>
  
  <p><strong>Steps:</strong></p>
  
  <p>1) Go to <a href="https://www.mywebsite.com" rel="nofollow noreferrer">https://www.mywebsite.com</a> (For reference)</p>
  
  <p>2) Export the keystore of the above website to <code>C:\Program Files\Java\jre7\lib\security</code>.</p>
  
  <p>3) Import it to cacerts to add a self signed signature using keytool as </p>
  
  <pre><code>keytool -import -alias my-cert -file c:\cert.crt -keystore %JAVA_HOME%/jre/lib/security/cacerts
  </code></pre>
  
  <p>After doing the above steps I used the following program:</p>
  
  <pre><code>String keystorePathAndName = "C:\\Program Files\\Java\\jre7\\lib\\security\\mykeystore";
  String keystoreType = "der";
  
  String keystorePass = "";
  
  Integer port = 8089;
  if (System.getProperty("port") != null) {
      port = Integer.valueOf(System.getProperty("port"));
  }
  // Create a server listening on port 8089
  Component component = new Component();
  Server server = component.getServers().add(Protocol.HTTPS, port);
  Series&lt;Parameter&gt; params = server.getContext().getParameters();
  params.add("keystorePath", keystorePathAndName);
  params.add("keystoreType", keystoreType);
  
  params.add("keystorePassword", keystorePass);
  
  
  component.getDefaultHost().attach("/Simulator",new UserApplication());
  component.start();
  </code></pre>
  
  <p><strong>Error Logs:</strong></p>
  
  <pre><code>Exception in thread "main" java.security.KeyStoreException: der not found
      at java.security.KeyStore.getInstance(KeyStore.java:616)
      at org.restlet.engine.ssl.DefaultSslContextFactory.createSslContext(DefaultSslContextFactory.java:299)
      at org.restlet.engine.connector.HttpsServerHelper.start(HttpsServerHelper.java:92)
      at org.restlet.Server.start(Server.java:579)
      at org.restlet.Component.startServers(Component.java:642)
      at org.restlet.Component.start(Component.java:567)
      at com.user.app.userapp.main.AppServer.main(AppServer.java:78)
  Caused by: java.security.NoSuchAlgorithmException: der KeyStore not available
      at sun.security.jca.GetInstance.getInstance(GetInstance.java:159)
      at java.security.Security.getImpl(Security.java:695)
      at java.security.KeyStore.getInstance(KeyStore.java:613)
      ... 6 more
  </code></pre>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>In response to the Lolo's answer, I am not getting <code>PKCS12</code> OR <code>JKS</code> formats when trying to save the keystore.</p>
  
  <p><img src="https://i.stack.imgur.com/Nh3HI.png" alt="enter image description here"></p>