System.out.println("AdminEntity, match : caid " + caid + " admincaid " + admincaid);
    public boolean match(AdminInformation admininformation) {      boolean returnvalue=false;      if(admininformation.isSpecialUser()){        System.out.println("AdminEntity: Matching Special User :" + this.matchtype + " = " + admininformation.getSpecialUser());           if(this.matchtype ==  admininformation.getSpecialUser()){          // There is a match of special admin return true;          returnvalue = true;        }      }      else{        X509Certificate certificate = admininformation.getX509Certificate();        String certstring = certificate.getSubjectDN().toString();        int admincaid = certificate.getIssuerDN().toString().hashCode();        //String serialnumber = certificate.getSerialNumber().toString(16);        certstring = serialPattern.matcher(certstring).replaceAll("SN=");        int parameter;        int size=0;        String[] clientstrings=null;        // First check that issuers match.        if(this.caid == admincaid){          // Determine part of certificate to match with.          DNFieldExtractor dn = new DNFieldExtractor(certstring,DNFieldExtractor.TYPE_SUBJECTDN);          if(matchwith == WITH_SERIALNUMBER){            if(certificate!=null){              switch(matchtype){                case TYPE_EQUALCASE:                case TYPE_EQUALCASEINS:                    try{                      returnvalue = (new java.math.BigInteger(matchvalue,16)).equals(certificate.getSerialNumber());                    }catch(java.lang.NumberFormatException nfe){}                    break;                case TYPE_NOT_EQUALCASE:                case TYPE_NOT_EQUALCASEINS:                    try{                      returnvalue = !(new java.math.BigInteger(matchvalue,16)).equals(certificate.getSerialNumber());                    }catch(java.lang.NumberFormatException nfe){}                    break;                default:              }            }          }          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;    }