throw new ASN1ParsingException("malformed Extension"); OID extOid = (OID) der.read().getValue(); Boolean critical = Boolean.valueOf(false); DERValue val2 = der.read(); if (val2.getValue() instanceof Boolean) { critical = (Boolean) val2.getValue(); val2 = der.read(); } byte[] ext = (byte[]) val2.getValue(); extensions.put(extOid.toString(), ext); if (critical.booleanValue()) critOids.add(extOid.toString()); else nonCritOids.add(extOid.toString());
throw new IOException("malformed Extension"); debug("start Extension  len == " + val.getLength()); Extension e = new Extension(val.getEncoded()); extensions.put(e.getOid(), e); der.skip(val.getLength());
  private void parse(int version, InputStream in) throws Exception  {    DERReader der = new DERReader(in);    DERValue entry = der.read();    if (!entry.isConstructed())      throw new ASN1ParsingException("malformed revokedCertificate");    encoded = entry.getEncoded();    int len = 0;    DERValue val = der.read();    serialNo = (BigInteger) val.getValue();    len += DERWriter.definiteEncodingSize(val.getLength())         + val.getLength() + 1;    val = der.read();    revocationDate = (Date) val.getValue();    len += DERWriter.definiteEncodingSize(val.getLength())         + val.getLength() + 1;    if (len < entry.getLength())      {        if (version < 2)          throw new ASN1ParsingException("extra data in CRL entry");        while (len < entry.getLength())          {            val = der.read();            if (!val.isConstructed())              throw new ASN1ParsingException("malformed Extension");            OID extOid = (OID) der.read().getValue();            Boolean critical = Boolean.valueOf(false);            DERValue val2 = der.read();            if (val2.getValue() instanceof Boolean)              {                critical = (Boolean) val2.getValue();                val2 = der.read();              }            byte[] ext = (byte[]) val2.getValue();            extensions.put(extOid.toString(), ext);            if (critical.booleanValue())              critOids.add(extOid.toString());            else              nonCritOids.add(extOid.toString());            len += val.getEncodedLength();          }      }  }