private String findCipherAndStrength(byte[] supportedCiphers,String[] tokens){
  byte s;
  for (int i=0; i < strength.length; i++) {
    if ((s=strength[i]) != 0) {
      for (int j=0; j < supportedCiphers.length; j++) {
        if (s == supportedCiphers[j] && (specifiedCipher == null || specifiedCipher.equals(tokens[j]))) {
switch (s) {
case HIGH_STRENGTH:
            negotiatedStrength="high";
          break;
case MEDIUM_STRENGTH:
        negotiatedStrength="medium";
      break;
case LOW_STRENGTH:
    negotiatedStrength="low";
  break;
}
return tokens[j];
}
}
}
}
return null;
}

private String findCipherAndStrength ( byte [ ] supportedCiphers , String [ ] tokens ) { byte s ; for ( int i = 0 ; i < strength . length ; i ++ ) { if ( ( s = strength [ i ] ) != 0 ) { for ( int j = 0 ; j < supportedCiphers . length ; j ++ ) { if ( s == supportedCiphers [ j ] && ( specifiedCipher == null || specifiedCipher . equals ( tokens [ j ] ) ) ) { switch ( s ) { case HIGH_STRENGTH : negotiatedStrength = "high" ; break ; case MEDIUM_STRENGTH : negotiatedStrength = "medium" ; break ; case LOW_STRENGTH : negotiatedStrength = "low" ; break ; } return tokens [ j ] ; } } } } return null ; }
steps through the ordered ' strength ' array , and compares it with the ' supportedciphers ' array . the cipher returned represents the best possible cipher based on the strength preference and the available ciphers on both the server and client environments .
