def generate_signature(params)
      secret = params.delete(:secret)

      # jruby stumbles over empty secrets, we regard them as invalid anyways, so we return an empty digest if no scret was given
      if '' == secret.to_s
        nil
      else
        OpenSSL::HMAC.hexdigest(algorithm, secret, canonical_representation(params))
      end
    end
def generate_signature(params)
      secret = params.delete(:secret)

      # jruby stumbles over empty secrets, we regard them as invalid anyways, so we return an empty digest if no scret was given
      if '' == secret.to_s
        nil
      else
        OpenSSL::HMAC.hexdigest(algorithm, secret, canonical_representation(params))
      end
    end
create a new HMAC instance

 @param [String] algorithm   The hashing-algorithm to use. See the openssl documentation for valid values.
 @param [Hash] default_opts  The default options for all calls that take opts

 @option default_opts [String]             :auth_scheme ('HMAC')   The name of the authorization scheme used in the Authorization header and to construct various header-names
 @option default_opts [String]             :auth_param ('auth')   The name of the authentication param to use for query based authentication
 @option default_opts [String]             :auth_header ('Authorization') The name of the authorization header to use
 @option default_opts [String]             :auth_header_format ('%{auth_scheme} %{signature}') The format of the authorization header. Will be interpolated with the given options and the signature.
 @option default_opts [String]             :nonce_header ('X-#{auth_scheme}-Nonce') The header name for the request nonce
 @option default_opts [String]             :alternate_date_header ('X-#{auth_scheme}-Date') The header name for the alternate date header
 @option default_opts [Bool]               :query_based (false) Whether to use query based authentication
 @option default_opts [Bool]               :use_alternate_date_header (false) Use the alternate date header instead of `Date`
 @option default_opts [Hash]               :extra_auth_params ({}) Additional parameters to inject in the auth parameter
 @option default_opts [Array<Symbol>]      :ignore_params ([]) Params to ignore for signing

 Generate the signature from a hash representation

 returns nil if no secret or an empty secret was given

 @param [Hash] params the parameters to create the representation with
 @option params [String] :secret The secret to generate the signature with
 @option params [String] :method The HTTP Verb of the request
 @option params [String] :date The date of the request as it was formatted in the request
 @option params [String] :nonce ('') The nonce given in the request
 @option params [String] :path The path portion of the request
 @option params [Hash]   :query ({}) The query parameters given in the request. Must not contain the auth param.
 @option params [Hash]   :headers ({}) All headers given in the request (optional and required)
 @option params [String]             :auth_scheme ('HMAC')   The name of the authorization scheme used in the Authorization header and to construct various header-names
 @option params [String]             :auth_param ('auth')   The name of the authentication param to use for query based authentication
 @option params [Hash]               :extra_auth_params ({}) Additional parameters to inject in the auth parameter
 @option params [Array<Symbol>]      :ignore_params ([]) Params to ignore for signing
 @option params [String]             :auth_header ('Authorization') The name of the authorization header to use
 @option params [String]             :auth_header_format ('%{auth_scheme} %{signature}') The format of the authorization header. Will be interpolated with the given options and the signature.
 @option params [String]             :nonce_header ('X-#{auth_scheme}-Nonce') The header name for the request nonce
 @option params [String]             :alternate_date_header ('X-#{auth_scheme}-Date') The header name for the alternate date header
 @option params [Bool]               :query_based (false) Whether to use query based authentication
 @option params [Bool]               :use_alternate_date_header (false) Use the alternate date header instead of `Date`

 @return [String] the signature