code: public Map<String, String> signRequest(String accessKey, String secretKey,
  			String httpMethod, String endpointURL, String reqPath,
  			Map<String, String> headers, MultivaluedMap<String, String> params, byte[] jsonEntity) {
  
  		if (StringUtils.isBlank(accessKey)) {
  			logger.error("Blank access key: {} {}", httpMethod, reqPath);
  			return headers;
  		}
  
  		if (StringUtils.isBlank(secretKey)) {
  			logger.debug("Anonymous request: {} {}", httpMethod, reqPath);
  			if (headers == null) {
  				headers = new HashMap<>();
  			}
  			headers.put(HttpHeaders.AUTHORIZATION, "Anonymous " + accessKey);
  			return headers;
  		}
  
  		if (httpMethod == null) {
  			httpMethod = HttpMethod.GET;
  		}
  
  		InputStream in = null;
  		Map<String, String> sigParams = new HashMap<>();
  
  		if (params != null) {
  			for (Map.Entry<String, List<String>> param : params.entrySet()) {
  				String key = param.getKey();
  				List<String> value = param.getValue();
  				if (value != null && !value.isEmpty() && value.get(0) != null) {
  					sigParams.put(key, value.get(0));
  				}
  			}
  		}
  
  		if (jsonEntity != null && jsonEntity.length > 0) {
  			in = new ByteArrayInputStream(jsonEntity);
  		}
  
  		return sign(httpMethod, endpointURL, reqPath, headers, sigParams, in, accessKey, secretKey);
  	}
docs: Builds and signs a request to an API endpoint using the provided credentials.
  @param accessKey access key
  @param secretKey secret key
  @param httpMethod the method (GET, POST...)
  @param endpointURL protocol://host:port
  @param reqPath the API resource path relative to the endpointURL
  @param headers headers map
  @param params parameters map
  @param jsonEntity an object serialized to JSON byte array (payload), could be null
  @return a map containing the "Authorization" header