title: How to get private key from browser keystore?
body: <p>I read certificates from keystore browser, there is some problem with getting private key, but public key get perfect. Below is code:</p>
  
  <pre><code>KeyStore keystore1 = KeyStore.getInstance("Windows-MY");
  keystore1.load(null, null);
  
  if (keystore1 != null) {
    Enumeration&lt;String&gt; enumeration = keystore1.aliases();
  
    while (enumeration.hasMoreElements()) {
      String alias = enumeration.nextElement();
      if (alias.equals("myalias")) {
         char[] keypwd = "123456".toCharArray();
         KeyStore.PrivateKeyEntry keyEnt = (KeyStore.PrivateKeyEntry) keystore1.getEntry(alias, new KeyStore.PasswordProtection(keypwd));     
         System.out.println("getPublicKey: " + keyEnt.getCertificate().getPublicKey().getEncoded());
  
         //show RSAPrivateKey [size=2048 bits, type=Exchange, container={5089EC94-FF45-4339-ACCF-E6ECCCB16899}]
         System.out.println("privateKey111: " + keyEnt.getPrivateKey()); 
      }
    }
  }
  </code></pre>
  
  <p>Public key output is correct, but private key looks like this:</p>
  
  <p><code>RSAPrivateKey [size=2048 bits, type=Exchange, container={5089EC94-FF45-4339-ACCF-E6ECCCB16899}]</code></p>
  
  <p>Password is correct. How can I get private key?</p>