def check_that_request_was_signed(certificate_public_key, request, raw_body)
      signed_by_certificate = certificate_public_key.verify(
        OpenSSL::Digest::SHA1.new,
        Base64.decode64(request.env['HTTP_SIGNATURE']),
        raw_body
      )

      raise AlexaVerifier::InvalidRequestError, 'Signature does not match certificate provided' unless signed_by_certificate
    end
def check_that_request_was_signed(certificate_public_key, request, raw_body)
      signed_by_certificate = certificate_public_key.verify(
        OpenSSL::Digest::SHA1.new,
        Base64.decode64(request.env['HTTP_SIGNATURE']),
        raw_body
      )

      raise AlexaVerifier::InvalidRequestError, 'Signature does not match certificate provided' unless signed_by_certificate
    end
Check that our request was signed by a given public key.

 @param [OpenSSL::PKey::PKey] certificate_public_key the public key we are checking
 @param [Rack::Request::Env] request the request object we are checking
 @param [String] raw_body the raw body of our https request
 @raise [AlexaVerifier::InvalidRequestError] raised if our signature does not match the certificate provided