title: java.security.cert.CertificateParsingException: signed fields invalid
body: <p>I'm trying to read a   <code>X509 certificate</code>  </p>
  
  <pre><code>FileInputStream fr = new FileInputStream("suresh.pfx");
  CertificateFactory cf =   CertificateFactory.getInstance("X509");
  X509Certificate c = (X509Certificate) cf.generateCertificate(fr); 
  </code></pre>
  
  <p>And run in to the exception</p>
  
  <pre><code>java.security.cert.CertificateParsingException: signed fields invalid
      at sun.security.x509.X509CertImpl.parse(Unknown Source)
      at sun.security.x509.X509CertImpl.&lt;init&gt;(Unknown Source)
      at sun.security.provider.X509Factory.engineGenerateCertificate(Unknown Source)
      at java.security.cert.CertificateFactory.generateCertificate(Unknown Source)
      at com.nextenders.certificategeenrator.CertificateGenerator.testGenerateSignCertWithKeyStore(CertificateGenerator.java:102)
      at com.nextenders.certificategeenrator.CertificateGenerator.main(CertificateGenerator.java:65)
  </code></pre>
  
  <p>Found something related to it from <a href="https://community.oracle.com/thread/1539590?tstart=1495" rel="noreferrer">Oracle  forum</a> with no solution.</p>
  
  <p>Any hints ?</p>