|
15 | 15 | import java.io.BufferedInputStream;
|
16 | 16 | import java.io.ByteArrayInputStream;
|
17 | 17 | import java.io.File;
|
| 18 | +import java.io.StringReader; |
18 | 19 | import java.security.cert.CertificateException;
|
19 | 20 | import java.security.cert.CertificateFactory;
|
20 | 21 | import java.security.cert.CertificateParsingException;
|
|
28 | 29 | import java.util.regex.Matcher;
|
29 | 30 | import java.util.regex.Pattern;
|
30 | 31 |
|
31 |
| -import org.bouncycastle.asn1.ASN1InputStream; |
32 | 32 | import org.bouncycastle.asn1.x509.CertificateList;
|
33 | 33 | import org.bouncycastle.asn1.x509.TBSCertList;
|
| 34 | +import org.bouncycastle.cert.X509CRLHolder; |
| 35 | +import org.bouncycastle.openssl.PEMParser; |
34 | 36 | import org.hyperledger.fabric.sdk.Enrollment;
|
35 | 37 | import org.hyperledger.fabric.sdk.security.CryptoSuite;
|
36 | 38 | import org.hyperledger.fabric.sdk.testutils.TestConfig;
|
@@ -498,10 +500,10 @@ TBSCertList.CRLEntry[] parseCRL(String crl) throws Exception {
|
498 | 500 | Base64.Decoder b64dec = Base64.getDecoder();
|
499 | 501 | final byte[] decode = b64dec.decode(crl.getBytes(UTF_8));
|
500 | 502 |
|
501 |
| - ByteArrayInputStream inStream = new ByteArrayInputStream(decode); |
502 |
| - ASN1InputStream asnInputStream = new ASN1InputStream(inStream); |
| 503 | + PEMParser pem = new PEMParser(new StringReader(new String(decode))); |
| 504 | + X509CRLHolder holder = (X509CRLHolder) pem.readObject(); |
503 | 505 |
|
504 |
| - return CertificateList.getInstance(asnInputStream.readObject()).getRevokedCertificates(); |
| 506 | + return holder.toASN1Structure().getRevokedCertificates(); |
505 | 507 | }
|
506 | 508 |
|
507 | 509 | @Test
|
|
0 commit comments