/**
   * Return an array of attributes matching the passed in type OID.
   *
   * @param type the type of the attribute being looked for.
   * @return an array of Attribute of the requested type, zero length if none present.
   */
  public Attribute[] getAttributes(ASN1ObjectIdentifier type) {
    ASN1Sequence seq = attrCert.getAcinfo().getAttributes();
    List list = new ArrayList();

    for (int i = 0; i != seq.size(); i++) {
      Attribute attr = Attribute.getInstance(seq.getObjectAt(i));
      if (attr.getAttrType().equals(type)) {
        list.add(attr);
      }
    }

    if (list.size() == 0) {
      return EMPTY_ARRAY;
    }

    return (Attribute[]) list.toArray(new Attribute[list.size()]);
  }
  /**
   * Return the attributes, if any associated with this request.
   *
   * @return an array of Attribute, zero length if none present.
   */
  public Attribute[] getAttributes() {
    ASN1Sequence seq = attrCert.getAcinfo().getAttributes();
    Attribute[] attrs = new Attribute[seq.size()];

    for (int i = 0; i != seq.size(); i++) {
      attrs[i] = Attribute.getInstance(seq.getObjectAt(i));
    }

    return attrs;
  }