title: KeyStoreException Access is Denied
body: <p>I am trying to add my self sign certificate to Window trust Store.</p>
  
  <pre><code>KeyStore root = KeyStore.getInstance("Windows-ROOT");
  root.load(null,null);
  FileInputStream in = new FileInputStream("mycer.cer");
  X509Certificate cacert =     (X509Certificate)CertificateFactory.getInstance("X.509").generateCertificate(in)    ;
  root.setCertificateEntry("selfsignedcert", cacert);
  </code></pre>
  
  <p>But I get this exception.</p>
  
  <blockquote>
    <p>java.security.KeyStoreException: Access is denied.</p>
  </blockquote>
  
  <p>Any thoughts how to solve this issue.</p>
  
  <p>Thanks.</p>