title: Invalid DER-encoded CRL data java
body: <p>I am trying to check if x509 certificate is revoked or not:</p>
  
  <pre><code>CertificateFactory cf = CertificateFactory.getInstance("X.509");
  X509CRL crl = (X509CRL) cf.generateCRL(crlFile);
  if (crl.isRevoked(certRSA)) {
      System.out.println("REVOKED");
  } else {
      System.out.println("NOT REVOKED");
  }
  </code></pre>
  
  <p>and getting this Exception:</p>
  
  <pre><code>java.security.cert.CRLException: Invalid DER-encoded CRL data
      at sun.security.x509.X509CRLImpl.parse(X509CRLImpl.java:981)
      at sun.security.x509.X509CRLImpl.&lt;init&gt;(X509CRLImpl.java:144)
      ....
  </code></pre>
  
  <p>How can I convert that crl file into DER-encoded crl file? Thanks!</p>