def signature_components(params, date, body_sha)
canonical_request = "\#{params[:method].to_s.upcase}\n\#{canonical_path(params[:path])}\n\#{canonical_query_string(params[:query])}\n\#{canonical_headers(params[:headers])}\n\#{signed_headers(params[:headers])}\n\#{body_sha || OpenSSL::Digest::SHA256.hexdigest(params[:body] || '')}\n"
canonical_request.chop!
string_to_sign = "\#{ALGORITHM}\n\#{date.to_iso8601_basic}\n\#{credential_scope(date)}\n\#{OpenSSL::Digest::SHA256.hexdigest(canonical_request)}\n"
string_to_sign.chop!
signature = derived_hmac(date).sign(string_to_sign)
{
'X-Amz-Algorithm' => ALGORITHM,
'X-Amz-Credential' => "#{@aws_access_key_id}/#{credential_scope(date)}",
'X-Amz-SignedHeaders' => signed_headers(params[:headers]),
'X-Amz-Signature' => signature.unpack('H*').first
}
end