private static void extractDirective(String key,byte[] value,String[] keyTable,byte[][] valueTable,List<byte[]> realmChoices,int realmIndex) throws SaslException {
  for (int i=0; i < keyTable.length; i++) {
    if (key.equalsIgnoreCase(keyTable[i])) {
      if (valueTable[i] == null) {
        valueTable[i]=value;
        if (logger.isLoggable(Level.FINE)) {
          logger.log(Level.FINE,"DIGEST11:Directive {0} = {1}",new Object[]{keyTable[i],new String(valueTable[i])});
        }
      }
 else       if (realmChoices != null && i == realmIndex) {
        if (realmChoices.isEmpty()) {
          realmChoices.add(valueTable[i]);
        }
        realmChoices.add(value);
      }
 else {
        throw new SaslException("DIGEST-MD5: peer sent more than one " + key + " directive: "+ new String(value));
      }
      break;
    }
  }
}

private static void extractDirective ( String key , byte [ ] value , String [ ] keyTable , byte [ ] [ ] valueTable , List < byte [ ] > realmChoices , int realmIndex ) throws SaslException { for ( int i = 0 ; i < keyTable . length ; i ++ ) { if ( key . equalsIgnoreCase ( keyTable [ i ] ) ) { if ( valueTable [ i ] == null ) { valueTable [ i ] = value ; if ( logger . isLoggable ( Level . FINE ) ) { logger . log ( Level . FINE , "DIGEST11:Directive {0} = {1}" , new Object [ ] { keyTable [ i ] , new String ( valueTable [ i ] ) } ) ; } } else if ( realmChoices != null && i == realmIndex ) { if ( realmChoices . isEmpty ( ) ) { realmChoices . add ( valueTable [ i ] ) ; } realmChoices . add ( value ) ; } else { throw new SaslException ( "DIGEST-MD5: peer sent more than one " + key + " directive: " + new String ( value ) ) ; } break ; } } }
processes directive / value pairs from the digest - challenge and fill out the challengeval array .
