if(field == OLDEMAILDN || field == RFC822NAME){ if(!isModifyable(EMAIL,0)){ String[] values; try{ values = new RE(SPLITCHAR, false).split(getValue(EMAIL,number)); }catch(Exception e){ throw new UserDoesntFullfillEndEntityProfile("Error parsing end entity profile."); } boolean exists = false; for(int i = 0; i < values.length ; i++){ if(data.equals(values[i].trim())) exists = true; } if(!exists) throw new UserDoesntFullfillEndEntityProfile("Field " + text + " data didn't match requirement of end entity profile.");
if(field == OLDDNE || field == RFC822NAME){ if(isRequired(field,number)){ if(!data.trim().equals(email.trim())) throw new UserDoesntFullfillEndEntityProfile("Field " + text + " data didn't match Email field.");
    private void checkIfDataFullfillProfile(int field, int number, String data, String text) throws UserDoesntFullfillEndEntityProfile {              if(data == null && field != EMAIL)          throw new UserDoesntFullfillEndEntityProfile("Field " +  text + " cannot be null.");               if(data !=null)                if(!getUse(field,number) && !data.trim().equals(""))          throw new UserDoesntFullfillEndEntityProfile(text + " cannot be used in end entity profile.");       if(field == OLDEMAILDN || field == RFC822NAME){        if(!isModifyable(EMAIL,0)){          String[] values;            try{              values = new RE(SPLITCHAR, false).split(getValue(EMAIL,number));           }catch(Exception e){                       throw new UserDoesntFullfillEndEntityProfile("Error parsing end entity profile.");           }             boolean exists = false;          for(int i = 0; i < values.length ; i++){            if(data.equals(values[i].trim()))               exists = true;          }             if(!exists)            throw new UserDoesntFullfillEndEntityProfile("Field " + text + " data didn't match requirement of end entity profile.");                   }            }      else{        if(!isModifyable(field,number)){          String[] values;               try{              values = new RE(SPLITCHAR, false).split(getValue(field,number));           }catch(Exception e){                      throw new UserDoesntFullfillEndEntityProfile("Error parsing end entity profile.");           }             boolean exists = false;          for(int i = 0; i < values.length ; i++){            if(data.equals(values[i].trim()))               exists = true;          }             if(!exists)            throw new UserDoesntFullfillEndEntityProfile("Field " + text + " data didn't match requirement of end entity profile.");                   }      }      }