@Test public void parseCRLWithoutRevokedCertificates() throws IOException { try (InputStream fis = CRLParserTest.class.getResourceAsStream("/DS_NA2_CA-B1.crl"); BufferedInputStream is = new BufferedInputStream(fis)) { CRLInfo handler = parser.retrieveInfo(is); assertEquals("1.2.840.113549.1.1.11", handler.getCertificateListSignatureAlgorithmOid()); assertNotNull(handler.getIssuer()); assertNotNull(handler.getThisUpdate()); assertNotNull(handler.getNextUpdate()); assertTrue(handler.getCriticalExtensions().isEmpty()); assertTrue(!handler.getNonCriticalExtensions().isEmpty()); assertTrue(Utils.isArrayEmpty(handler.getNonCriticalExtension("2.5.29.60"))); assertEquals("1.2.840.113549.1.1.11", handler.getTbsSignatureAlgorithmOid()); byte[] signatureValue = handler.getSignatureValue(); assertTrue(Utils.isArrayNotEmpty(signatureValue)); } }
public CRLInfo retrieveInfo(InputStream s) throws IOException { if (!s.markSupported()) { throw new IllegalArgumentException("The InputStream MUST support mark/reset methods !"); } CRLInfo infos = new CRLInfo(); consumeTagIntro(s); consumeTagIntro(s); int tag = DERUtil.readTag(s); int tagNo = DERUtil.readTagNumber(s, tag); int length = DERUtil.readLength(s); if (tagNo == BERTags.INTEGER) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("TBSCertList -> version : {}", Hex.toHexString(array)); } infos.setVersion(rebuildASN1Integer(array).getValue().intValue() + 1); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (tagNo == BERTags.SEQUENCE) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("TBSCertList -> signatureAlgorithm : {}", Hex.toHexString(array)); } AlgorithmIdentifier algoId = AlgorithmIdentifier.getInstance(rebuildASN1Sequence(array)); ASN1ObjectIdentifier oid = algoId.getAlgorithm(); infos.setCertificateListSignatureAlgorithmOid(oid.getId()); ASN1Encodable parameters = algoId.getParameters(); if (parameters != null && !DERNull.INSTANCE.equals(parameters)) { infos.setCertificateListSignatureAlgorithmParams(parameters.toASN1Primitive().getEncoded(ASN1Encoding.DER)); } tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (tagNo == BERTags.SEQUENCE) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("TBSCertList -> issuer : {}", Hex.toHexString(array)); } ASN1Sequence sequence = rebuildASN1Sequence(array); infos.setIssuer(new X500Principal(sequence.getEncoded())); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (isDate(tagNo)) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("TBSCertList -> thisUpdate : {}", Hex.toHexString(array)); } Time time = rebuildASN1Time(tagNo, array); infos.setThisUpdate(time.getDate()); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (isDate(tagNo)) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("TBSCertList -> nextUpdate : {}", Hex.toHexString(array)); } Time time = rebuildASN1Time(tagNo, array); infos.setNextUpdate(time.getDate()); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (tagNo == BERTags.SEQUENCE) { if (length > 0) { s.mark(10); int intraTag = DERUtil.readTag(s); int intraTagNo = DERUtil.readTagNumber(s, intraTag); s.reset(); if (intraTagNo == BERTags.SEQUENCE) { skip(s, length); LOG.debug("TBSCertList -> revokedCertificates : skipped (length={})", length); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } } else { LOG.debug("TBSCertList -> revokedCertificates : Empty sequence"); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } } boolean isTagged = (tag & BERTags.TAGGED) != 0; if (isTagged) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("TBSCertList -> crlExtensions : {}", Hex.toHexString(array)); } ASN1Sequence sequenceExtensions = (ASN1Sequence) ASN1Primitive.fromByteArray(array); extractExtensions(sequenceExtensions, infos); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (BERTags.SEQUENCE == tagNo) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("CertificateList -> signatureAlgorithm : {}", Hex.toHexString(array)); } AlgorithmIdentifier algoId = AlgorithmIdentifier.getInstance(rebuildASN1Sequence(array)); infos.setTbsSignatureAlgorithmOid(algoId.getAlgorithm().getId()); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (BERTags.BIT_STRING == tagNo) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("CertificateList -> signatureValue : {}", Hex.toHexString(array)); } infos.setSignatureValue(rebuildASN1BitString(array).getOctets()); } return infos; }
CRLParser { public CRLInfo retrieveInfo(InputStream s) throws IOException { if (!s.markSupported()) { throw new IllegalArgumentException("The InputStream MUST support mark/reset methods !"); } CRLInfo infos = new CRLInfo(); consumeTagIntro(s); consumeTagIntro(s); int tag = DERUtil.readTag(s); int tagNo = DERUtil.readTagNumber(s, tag); int length = DERUtil.readLength(s); if (tagNo == BERTags.INTEGER) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("TBSCertList -> version : {}", Hex.toHexString(array)); } infos.setVersion(rebuildASN1Integer(array).getValue().intValue() + 1); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (tagNo == BERTags.SEQUENCE) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("TBSCertList -> signatureAlgorithm : {}", Hex.toHexString(array)); } AlgorithmIdentifier algoId = AlgorithmIdentifier.getInstance(rebuildASN1Sequence(array)); ASN1ObjectIdentifier oid = algoId.getAlgorithm(); infos.setCertificateListSignatureAlgorithmOid(oid.getId()); ASN1Encodable parameters = algoId.getParameters(); if (parameters != null && !DERNull.INSTANCE.equals(parameters)) { infos.setCertificateListSignatureAlgorithmParams(parameters.toASN1Primitive().getEncoded(ASN1Encoding.DER)); } tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (tagNo == BERTags.SEQUENCE) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("TBSCertList -> issuer : {}", Hex.toHexString(array)); } ASN1Sequence sequence = rebuildASN1Sequence(array); infos.setIssuer(new X500Principal(sequence.getEncoded())); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (isDate(tagNo)) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("TBSCertList -> thisUpdate : {}", Hex.toHexString(array)); } Time time = rebuildASN1Time(tagNo, array); infos.setThisUpdate(time.getDate()); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (isDate(tagNo)) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("TBSCertList -> nextUpdate : {}", Hex.toHexString(array)); } Time time = rebuildASN1Time(tagNo, array); infos.setNextUpdate(time.getDate()); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (tagNo == BERTags.SEQUENCE) { if (length > 0) { s.mark(10); int intraTag = DERUtil.readTag(s); int intraTagNo = DERUtil.readTagNumber(s, intraTag); s.reset(); if (intraTagNo == BERTags.SEQUENCE) { skip(s, length); LOG.debug("TBSCertList -> revokedCertificates : skipped (length={})", length); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } } else { LOG.debug("TBSCertList -> revokedCertificates : Empty sequence"); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } } boolean isTagged = (tag & BERTags.TAGGED) != 0; if (isTagged) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("TBSCertList -> crlExtensions : {}", Hex.toHexString(array)); } ASN1Sequence sequenceExtensions = (ASN1Sequence) ASN1Primitive.fromByteArray(array); extractExtensions(sequenceExtensions, infos); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (BERTags.SEQUENCE == tagNo) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("CertificateList -> signatureAlgorithm : {}", Hex.toHexString(array)); } AlgorithmIdentifier algoId = AlgorithmIdentifier.getInstance(rebuildASN1Sequence(array)); infos.setTbsSignatureAlgorithmOid(algoId.getAlgorithm().getId()); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (BERTags.BIT_STRING == tagNo) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("CertificateList -> signatureValue : {}", Hex.toHexString(array)); } infos.setSignatureValue(rebuildASN1BitString(array).getOctets()); } return infos; } }
CRLParser { public CRLInfo retrieveInfo(InputStream s) throws IOException { if (!s.markSupported()) { throw new IllegalArgumentException("The InputStream MUST support mark/reset methods !"); } CRLInfo infos = new CRLInfo(); consumeTagIntro(s); consumeTagIntro(s); int tag = DERUtil.readTag(s); int tagNo = DERUtil.readTagNumber(s, tag); int length = DERUtil.readLength(s); if (tagNo == BERTags.INTEGER) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("TBSCertList -> version : {}", Hex.toHexString(array)); } infos.setVersion(rebuildASN1Integer(array).getValue().intValue() + 1); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (tagNo == BERTags.SEQUENCE) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("TBSCertList -> signatureAlgorithm : {}", Hex.toHexString(array)); } AlgorithmIdentifier algoId = AlgorithmIdentifier.getInstance(rebuildASN1Sequence(array)); ASN1ObjectIdentifier oid = algoId.getAlgorithm(); infos.setCertificateListSignatureAlgorithmOid(oid.getId()); ASN1Encodable parameters = algoId.getParameters(); if (parameters != null && !DERNull.INSTANCE.equals(parameters)) { infos.setCertificateListSignatureAlgorithmParams(parameters.toASN1Primitive().getEncoded(ASN1Encoding.DER)); } tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (tagNo == BERTags.SEQUENCE) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("TBSCertList -> issuer : {}", Hex.toHexString(array)); } ASN1Sequence sequence = rebuildASN1Sequence(array); infos.setIssuer(new X500Principal(sequence.getEncoded())); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (isDate(tagNo)) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("TBSCertList -> thisUpdate : {}", Hex.toHexString(array)); } Time time = rebuildASN1Time(tagNo, array); infos.setThisUpdate(time.getDate()); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (isDate(tagNo)) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("TBSCertList -> nextUpdate : {}", Hex.toHexString(array)); } Time time = rebuildASN1Time(tagNo, array); infos.setNextUpdate(time.getDate()); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (tagNo == BERTags.SEQUENCE) { if (length > 0) { s.mark(10); int intraTag = DERUtil.readTag(s); int intraTagNo = DERUtil.readTagNumber(s, intraTag); s.reset(); if (intraTagNo == BERTags.SEQUENCE) { skip(s, length); LOG.debug("TBSCertList -> revokedCertificates : skipped (length={})", length); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } } else { LOG.debug("TBSCertList -> revokedCertificates : Empty sequence"); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } } boolean isTagged = (tag & BERTags.TAGGED) != 0; if (isTagged) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("TBSCertList -> crlExtensions : {}", Hex.toHexString(array)); } ASN1Sequence sequenceExtensions = (ASN1Sequence) ASN1Primitive.fromByteArray(array); extractExtensions(sequenceExtensions, infos); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (BERTags.SEQUENCE == tagNo) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("CertificateList -> signatureAlgorithm : {}", Hex.toHexString(array)); } AlgorithmIdentifier algoId = AlgorithmIdentifier.getInstance(rebuildASN1Sequence(array)); infos.setTbsSignatureAlgorithmOid(algoId.getAlgorithm().getId()); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (BERTags.BIT_STRING == tagNo) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("CertificateList -> signatureValue : {}", Hex.toHexString(array)); } infos.setSignatureValue(rebuildASN1BitString(array).getOctets()); } return infos; }  }
CRLParser { public CRLInfo retrieveInfo(InputStream s) throws IOException { if (!s.markSupported()) { throw new IllegalArgumentException("The InputStream MUST support mark/reset methods !"); } CRLInfo infos = new CRLInfo(); consumeTagIntro(s); consumeTagIntro(s); int tag = DERUtil.readTag(s); int tagNo = DERUtil.readTagNumber(s, tag); int length = DERUtil.readLength(s); if (tagNo == BERTags.INTEGER) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("TBSCertList -> version : {}", Hex.toHexString(array)); } infos.setVersion(rebuildASN1Integer(array).getValue().intValue() + 1); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (tagNo == BERTags.SEQUENCE) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("TBSCertList -> signatureAlgorithm : {}", Hex.toHexString(array)); } AlgorithmIdentifier algoId = AlgorithmIdentifier.getInstance(rebuildASN1Sequence(array)); ASN1ObjectIdentifier oid = algoId.getAlgorithm(); infos.setCertificateListSignatureAlgorithmOid(oid.getId()); ASN1Encodable parameters = algoId.getParameters(); if (parameters != null && !DERNull.INSTANCE.equals(parameters)) { infos.setCertificateListSignatureAlgorithmParams(parameters.toASN1Primitive().getEncoded(ASN1Encoding.DER)); } tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (tagNo == BERTags.SEQUENCE) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("TBSCertList -> issuer : {}", Hex.toHexString(array)); } ASN1Sequence sequence = rebuildASN1Sequence(array); infos.setIssuer(new X500Principal(sequence.getEncoded())); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (isDate(tagNo)) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("TBSCertList -> thisUpdate : {}", Hex.toHexString(array)); } Time time = rebuildASN1Time(tagNo, array); infos.setThisUpdate(time.getDate()); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (isDate(tagNo)) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("TBSCertList -> nextUpdate : {}", Hex.toHexString(array)); } Time time = rebuildASN1Time(tagNo, array); infos.setNextUpdate(time.getDate()); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (tagNo == BERTags.SEQUENCE) { if (length > 0) { s.mark(10); int intraTag = DERUtil.readTag(s); int intraTagNo = DERUtil.readTagNumber(s, intraTag); s.reset(); if (intraTagNo == BERTags.SEQUENCE) { skip(s, length); LOG.debug("TBSCertList -> revokedCertificates : skipped (length={})", length); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } } else { LOG.debug("TBSCertList -> revokedCertificates : Empty sequence"); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } } boolean isTagged = (tag & BERTags.TAGGED) != 0; if (isTagged) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("TBSCertList -> crlExtensions : {}", Hex.toHexString(array)); } ASN1Sequence sequenceExtensions = (ASN1Sequence) ASN1Primitive.fromByteArray(array); extractExtensions(sequenceExtensions, infos); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (BERTags.SEQUENCE == tagNo) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("CertificateList -> signatureAlgorithm : {}", Hex.toHexString(array)); } AlgorithmIdentifier algoId = AlgorithmIdentifier.getInstance(rebuildASN1Sequence(array)); infos.setTbsSignatureAlgorithmOid(algoId.getAlgorithm().getId()); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (BERTags.BIT_STRING == tagNo) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("CertificateList -> signatureValue : {}", Hex.toHexString(array)); } infos.setSignatureValue(rebuildASN1BitString(array).getOctets()); } return infos; }  void getSignedData(BinaryFilteringInputStream is); X509CRLEntry retrieveRevocationInfo(InputStream s, BigInteger serialNumber); CRLInfo retrieveInfo(InputStream s); }
CRLParser { public CRLInfo retrieveInfo(InputStream s) throws IOException { if (!s.markSupported()) { throw new IllegalArgumentException("The InputStream MUST support mark/reset methods !"); } CRLInfo infos = new CRLInfo(); consumeTagIntro(s); consumeTagIntro(s); int tag = DERUtil.readTag(s); int tagNo = DERUtil.readTagNumber(s, tag); int length = DERUtil.readLength(s); if (tagNo == BERTags.INTEGER) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("TBSCertList -> version : {}", Hex.toHexString(array)); } infos.setVersion(rebuildASN1Integer(array).getValue().intValue() + 1); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (tagNo == BERTags.SEQUENCE) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("TBSCertList -> signatureAlgorithm : {}", Hex.toHexString(array)); } AlgorithmIdentifier algoId = AlgorithmIdentifier.getInstance(rebuildASN1Sequence(array)); ASN1ObjectIdentifier oid = algoId.getAlgorithm(); infos.setCertificateListSignatureAlgorithmOid(oid.getId()); ASN1Encodable parameters = algoId.getParameters(); if (parameters != null && !DERNull.INSTANCE.equals(parameters)) { infos.setCertificateListSignatureAlgorithmParams(parameters.toASN1Primitive().getEncoded(ASN1Encoding.DER)); } tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (tagNo == BERTags.SEQUENCE) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("TBSCertList -> issuer : {}", Hex.toHexString(array)); } ASN1Sequence sequence = rebuildASN1Sequence(array); infos.setIssuer(new X500Principal(sequence.getEncoded())); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (isDate(tagNo)) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("TBSCertList -> thisUpdate : {}", Hex.toHexString(array)); } Time time = rebuildASN1Time(tagNo, array); infos.setThisUpdate(time.getDate()); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (isDate(tagNo)) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("TBSCertList -> nextUpdate : {}", Hex.toHexString(array)); } Time time = rebuildASN1Time(tagNo, array); infos.setNextUpdate(time.getDate()); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (tagNo == BERTags.SEQUENCE) { if (length > 0) { s.mark(10); int intraTag = DERUtil.readTag(s); int intraTagNo = DERUtil.readTagNumber(s, intraTag); s.reset(); if (intraTagNo == BERTags.SEQUENCE) { skip(s, length); LOG.debug("TBSCertList -> revokedCertificates : skipped (length={})", length); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } } else { LOG.debug("TBSCertList -> revokedCertificates : Empty sequence"); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } } boolean isTagged = (tag & BERTags.TAGGED) != 0; if (isTagged) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("TBSCertList -> crlExtensions : {}", Hex.toHexString(array)); } ASN1Sequence sequenceExtensions = (ASN1Sequence) ASN1Primitive.fromByteArray(array); extractExtensions(sequenceExtensions, infos); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (BERTags.SEQUENCE == tagNo) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("CertificateList -> signatureAlgorithm : {}", Hex.toHexString(array)); } AlgorithmIdentifier algoId = AlgorithmIdentifier.getInstance(rebuildASN1Sequence(array)); infos.setTbsSignatureAlgorithmOid(algoId.getAlgorithm().getId()); tag = DERUtil.readTag(s); tagNo = DERUtil.readTagNumber(s, tag); length = DERUtil.readLength(s); } if (BERTags.BIT_STRING == tagNo) { byte[] array = readNbBytes(s, length); if (LOG.isDebugEnabled()) { LOG.debug("CertificateList -> signatureValue : {}", Hex.toHexString(array)); } infos.setSignatureValue(rebuildASN1BitString(array).getOctets()); } return infos; }  void getSignedData(BinaryFilteringInputStream is); X509CRLEntry retrieveRevocationInfo(InputStream s, BigInteger serialNumber); CRLInfo retrieveInfo(InputStream s);  }