title: keytool error: java.io.IOException: DER input, Integer tag error
body: <p>I'm trying to convert a private key in a Java Keystore into PEM Format. <a href="https://stackoverflow.com/questions/652916/converting-a-java-keystore-into-pem-format">This answer</a> explains that the first step is to convert the keystore into PKCS12 format using the <code>keytool</code> command.</p>
  
  <p>However, I get the following error:</p>
  
  <pre><code>$ keytool -importkeystore -srckeystore client.keystore.jks -destkeystore client1.p12 -srcstoretype JKS -deststoretype PKCS12 -srcalias client1 -destalias client1
  ...
  keytool error: java.io.IOException: DER input, Integer tag error
  </code></pre>
  
  <p>Searching for this error online tells me that this has to do with encryption. I know the source keystore is encrypted, but supplying the passwords in the command gives the exact same error. How can I export the private key?</p>