if (DEBUG) debug("    SerialNumber: " + serialNumber);
log.finest("    SerialNumber: " + serialNumber);
  public SignerInfo(BERReader ber) throws IOException  {    DERValue val = ber.read();    if (DEBUG)      debug("SignerInfo: " + val);    if (!val.isConstructed())      throw new BEREncodingException("malformed SignerInfo");    val = ber.read();    if (val.getTag() != BER.INTEGER)      throw new BEREncodingException("malformed Version");    version = (BigInteger) val.getValue();    if (DEBUG)      debug("  Version: " + version);    val = ber.read();    if (!val.isConstructed())      throw new BEREncodingException("malformed IssuerAndSerialNumber");    if (DEBUG)      debug("  IssuerAndSerialNumber: " + val);    val = ber.read();    if (!val.isConstructed())      throw new BEREncodingException("malformed Issuer");    issuer = new X500Principal(val.getEncoded());    ber.skip(val.getLength());    if (DEBUG)      debug("    Issuer: " + issuer);    val = ber.read();    if (val.getTag() != BER.INTEGER)      throw new BEREncodingException("malformed SerialNumber");    serialNumber = (BigInteger) val.getValue();    if (DEBUG)      debug("    SerialNumber: " + serialNumber);    val = ber.read();    if (!val.isConstructed())      throw new BEREncodingException("malformed DigestAlgorithmIdentifier");    if (DEBUG)      debug("  DigestAlgorithmIdentifier: " + val);    int count = 0;    DERValue val2 = ber.read();    if (val2.getTag() != BER.OBJECT_IDENTIFIER)      throw new BEREncodingException("malformed AlgorithmIdentifier");    digestAlgorithmId = (OID) val2.getValue();    if (DEBUG)      debug("    OID: " + digestAlgorithmId);    if (BERValue.isIndefinite(val))      {        val2 = ber.read();        if (val2 != BER.END_OF_SEQUENCE)          {            digestAlgorithmParams = val2.getEncoded();            val2 = ber.read();            if (val2 != BER.END_OF_SEQUENCE)              throw new BEREncodingException("expecting BER end-of-sequence");          }        else          digestAlgorithmParams = null;      }    else if (val2.getEncodedLength() < val.getLength())      {        val2 = ber.read();        digestAlgorithmParams = val2.getEncoded();        if (val2.isConstructed())          ber.skip(val2.getLength());      }    else      digestAlgorithmParams = null;    if(DEBUG)      debug("    params: " + (digestAlgorithmParams == null ? null                              : new BigInteger(digestAlgorithmParams).toString(16)));    val = ber.read();    if (val.getTag() == 0)      {        authenticatedAttributes = val.getEncoded();        val = ber.read();        if (val.isConstructed())          ber.skip(val.getLength());        if (DEBUG)          debug("  AuthenticatedAttributes: " + val);        val = ber.read();      }    else      authenticatedAttributes = null;    if (!val.isConstructed())      throw new BEREncodingException("malformed DigestEncryptionAlgorithmIdentifier");    if (DEBUG)      debug("  DigestEncryptionAlgorithmIdentifier: " + val);    count = 0;    val2 = ber.read();    if (val2.getTag() != BER.OBJECT_IDENTIFIER)      throw new BEREncodingException("malformed AlgorithmIdentifier");    digestEncryptionAlgorithmId = (OID) val2.getValue();    if (DEBUG)      debug("    OID: " + digestEncryptionAlgorithmId);    if (BERValue.isIndefinite(val))      {        val2 = ber.read();        if (val2 != BER.END_OF_SEQUENCE)          {            digestEncryptionAlgorithmParams = val2.getEncoded();            val2 = ber.read();            if (val2 != BER.END_OF_SEQUENCE)              throw new BEREncodingException("expecting BER end-of-sequence");          }        else          digestEncryptionAlgorithmParams = null;      }    else if (val2.getEncodedLength() < val.getLength())      {        val2 = ber.read();        digestEncryptionAlgorithmParams = val2.getEncoded();        if (val2.isConstructed())          ber.skip(val2.getLength());      }    else      digestEncryptionAlgorithmParams = null;    if(DEBUG)      debug("    params: " + (digestEncryptionAlgorithmParams == null ? null                              : new BigInteger(digestEncryptionAlgorithmParams).toString(16)));    val = ber.read();    if (val.getTag() != BER.OCTET_STRING)      throw new BEREncodingException("malformed EncryptedDigest");    encryptedDigest = (byte[]) val.getValue();    if (DEBUG)      debug("  EncryptedDigest: " + new BigInteger(1, encryptedDigest).toString(16));    if (ber.peek() == 1)      unauthenticatedAttributes = ber.read().getEncoded();    else      unauthenticatedAttributes = null;    if (ber.peek() == 0)      ber.read();  }