title: PKCS#12 : DerInputStream.getLength() exception
body: <p>I generate a certificate using the keytool command:</p>
  
  <pre><code>keytool -genkeypair -alias myRSAKey -keyalg RSA -keysize 1024 -keystore test.p12 -storepass test -storetype pkcs12
  </code></pre>
  
  <p>Then if I try to load it using java security API, after getting the file as a byte[] :</p>
  
  <pre><code>KeyStore ks = KeyStore.getInstance("PKCS12");
  try{
     ks.load(new ByteArrayInputStream(data), "test".toCharArray())
  } catch (Exception e){
     ...
  }
  </code></pre>
  
  <p>I get a DerInputStream.getLength(): lengthTag=127, too big exception.</p>
  
  <p>What is wrong?</p>