namePair.add(new Integer(name.getTag()));
namePair.add(Integer.valueOf(name.getTag()));
  public GeneralNames(final byte[] encoded) throws IOException  {    names = new LinkedList();    DERReader der = new DERReader(encoded);    DERValue nameList = der.read();    if (!nameList.isConstructed())      throw new IOException("malformed GeneralNames");    int len = 0;    int i = 0;    while (len < nameList.getLength())      {        DERValue name = der.read();        List namePair = new ArrayList(2);        int tagClass = name.getTagClass();        if (tagClass != DER.CONTEXT)          throw new IOException("malformed GeneralName: Tag class is " + tagClass);        namePair.add(new Integer(name.getTag()));        DERValue val = null;        switch (name.getTag())          {          case RFC822_NAME:          case DNS_NAME:          case X400_ADDRESS:          case URI:            namePair.add(new String((byte[]) name.getValue()));            break;          case OTHER_NAME:            // MUST return the encoded bytes of the OID/OctetString sequence            byte[] anotherName = name.getEncoded();            anotherName[0] = (byte) (DER.CONSTRUCTED|DER.SEQUENCE);            namePair.add(anotherName);            // DERReader goes back on Constructed things so we need to skip over them            DERValue skip = der.read(); // skip OID            skip = der.read(); // skip Octet String            break;                      case EDI_PARTY_NAME:            namePair.add(name.getValue());            break;          case DIRECTORY_NAME:            byte[] b = name.getEncoded();            b[0] = (byte) (DER.CONSTRUCTED|DER.SEQUENCE);            DERReader r = new DERReader (b);            r.read ();            namePair.add(new X500Principal(r.read ().getEncoded ()).toString());            break;          case IP_ADDRESS:            namePair.add(InetAddress.getByAddress((byte[]) name.getValue())                         .getHostAddress());            break;          case REGISTERED_ID:            byte[] bb = name.getEncoded();            bb[0] = (byte) DER.OBJECT_IDENTIFIER;            namePair.add(new OID(bb).toString());            break;          default:            throw new IOException("unknown tag " + name.getTag());          }        names.add(namePair);        len += name.getEncodedLength();      }  }