1

我正在尝试检查 x509 证书是否被吊销:

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");
}

并得到这个异常:

java.security.cert.CRLException: Invalid DER-encoded CRL data
    at sun.security.x509.X509CRLImpl.parse(X509CRLImpl.java:981)
    at sun.security.x509.X509CRLImpl.<init>(X509CRLImpl.java:144)
    ....

如何将该 crl 文件转换为 DER 编码的 crl 文件?谢谢!

4

0 回答 0