    # File lib/fog/aws/signaturev4.rb, line 13
          def sign(params, date)
            canonical_request = "\#{params[:method].to_s.upcase}\n\#{params[:path]}\n\#{canonical_query_string(params[:query])}\n\#{canonical_headers(params[:headers])}\n\#{signed_headers(params[:headers])}\n\#{Digest::SHA256.hexdigest(params[:body] || '')}\n"
            canonical_request.chop!
            credential_scope = "#{date.utc.strftime('%Y%m%d')}/#{@region}/#{@service}/aws4_request"
            string_to_sign = "AWS4-HMAC-SHA256\n\#{date.to_iso8601_basic}\n\#{credential_scope}\n\#{Digest::SHA256.hexdigest(canonical_request)}\n"

            string_to_sign.chop!

            signature = derived_hmac(date).sign(string_to_sign)

            "AWS4-HMAC-SHA256 Credential=#{@aws_access_key_id}/#{credential_scope}, SignedHeaders=#{signed_headers(params[:headers])}, Signature=#{signature.unpack('H*').first}"
          end