parameter = DNFieldExtractor.ORGANIZATIONUNIT;
parameter = DNFieldExtractor.OU;
    public boolean match(AdminInformation admininformation) {        boolean returnvalue=false;              if(admininformation.isSpecialUser()){        if(this.matchtype ==  admininformation.getSpecialUser()){          // There is a match of special admin return true;            returnvalue = true;          }      }      else{        X509Certificate certificate = admininformation.getX509Certificate();        String certstring = certificate.getSubjectX500Principal().toString();        String serialnumber = certificate.getSerialNumber().toString(16);        int parameter;        int size=0;        String[] clientstrings=null;                // Determine part of certificate to match with.        DNFieldExtractor dn = new DNFieldExtractor(certstring,DNFieldExtractor.TYPE_SUBJECTDN);        if(matchwith == WITH_SERIALNUMBER){           if(serialnumber!=null){             size = 1;               clientstrings    = new String[1];             clientstrings[0] = serialnumber.trim();           }           else{             clientstrings= null;           }                             }        else{                    parameter = DNFieldExtractor.COMMONNAME;            switch(matchwith){            case WITH_COUNTRY:              parameter = DNFieldExtractor.COUNTRY;              break;            case WITH_DOMAINCOMPONENT:              parameter = DNFieldExtractor.DOMAINCOMPONENT;              break;                           case WITH_STATE:                  parameter = DNFieldExtractor.LOCALE;              break;            case WITH_LOCALE:              parameter = DNFieldExtractor.STATE;              break;                          case WITH_ORGANIZATION:              parameter = DNFieldExtractor.ORGANIZATION;              break;           case WITH_ORGANIZATIONUNIT:              parameter = DNFieldExtractor.ORGANIZATIONUNIT;              break;           case WITH_TITLE:              parameter = DNFieldExtractor.TITLE;              break;           case WITH_DNSERIALNUMBER:              parameter = DNFieldExtractor.SERIALNUMBER;              break;           case WITH_COMMONNAME:              parameter = DNFieldExtractor.COMMONNAME;              break;                         default:          }          size = dn.getNumberOfFields(parameter);          clientstrings = new String[size];          for(int i=0; i < size; i++){            clientstrings[i] = dn.getField(parameter,i);            }                  }                           // Determine how to match.        if(clientstrings!=null){          switch(matchtype){            case TYPE_EQUALCASE:              for(int i=0; i < size ; i++){                  returnvalue = clientstrings[i].equals(matchvalue);                if(returnvalue)                  break;                }                break;            case TYPE_EQUALCASEINS:              for(int i=0; i < size ; i++){                                returnvalue = clientstrings[i].equalsIgnoreCase(matchvalue);                if(returnvalue)                  break;                }                               break;            case TYPE_NOT_EQUALCASE:              for(int i=0; i < size ; i++){                                 returnvalue = !clientstrings[i].equals(matchvalue);                if(returnvalue)                  break;                }                                 break;            case TYPE_NOT_EQUALCASEINS:              for(int i=0; i < size ; i++){                                  returnvalue = !clientstrings[i].equalsIgnoreCase(matchvalue);                if(returnvalue)                  break;                }                               break;            default:           }          }        }      return returnvalue;    }