String serialnumber = certificate.getSerialNumber().toString(16);
    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 = CertTools.getSubjectDN(certificate);        String serialnumber = certificate.getSerialNumber().toString(16);        try{          certstring = new RegularExpression.RE("SERIALNUMBER=",false).replace(certstring,"SN=");        }catch(Exception e){}        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().toLowerCase();           }           else{             clientstrings= null;           }        }        else{          parameter = DNFieldExtractor.CN;          switch(matchwith){            case WITH_COUNTRY:              parameter = DNFieldExtractor.C;              break;            case WITH_DOMAINCOMPONENT:              parameter = DNFieldExtractor.DC;              break;             case WITH_STATE:              parameter = DNFieldExtractor.L;              break;            case WITH_LOCALE:              parameter = DNFieldExtractor.ST;              break;            case WITH_ORGANIZATION:              parameter = DNFieldExtractor.O;              break;           case WITH_ORGANIZATIONUNIT:              parameter = DNFieldExtractor.OU;              break;           case WITH_TITLE:              parameter = DNFieldExtractor.T;              break;           case WITH_DNSERIALNUMBER:              parameter = DNFieldExtractor.SN;              break;           case WITH_COMMONNAME:              parameter = DNFieldExtractor.CN;              break;           case WITH_UID:              parameter = DNFieldExtractor.UID;              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;    }