code: public static ChainingMode getChainMode(String chainMode) {
  	if (chainMode==null) {
  		return null;
  	}
  	switch (chainMode) {
  		case "cbc": return ChainingMode.cbc;
  		case "cfb": return ChainingMode.cfb;
  		case "ecb": return ChainingMode.ecb;
  		default:
  			LOG.error("Uknown chainmode: \""+chainMode+"\"");
  			break;
  
  	}
  	return null;
  }
docs: Returns the ChainMode object matching the String.
  
  @param chainMode chain mode
  
  @return ChainMode object corresponding to chain mode. Null if does not correspond to any mode.