public String encodeKey(final String key){
  if (StringUtils.isEmpty(key)) {
    throw new IllegalArgumentException("Key cannot be empty");
  }
  try {
    return Hex.encodeHexString(key.getBytes("UTF-8"));
  }
 catch (  UnsupportedEncodingException uee) {
    throw new IllegalStateException(uee);
  }
}

public String encodeKey ( final String key ) { if ( StringUtils . isEmpty ( key ) ) { throw new IllegalArgumentException ( "Key cannot be empty" ) ; } try { return Hex . encodeHexString ( key . getBytes ( "UTF-8" ) ) ; } catch ( UnsupportedEncodingException uee ) { throw new IllegalStateException ( uee ) ; } }
encode the given key to hexadecimal .
