def login_by_cert
      @client = Google::APIClient.new

      key      = Google::APIClient::PKCS12.load_key(c('client_cert_file'), c('key_secret'))
      asserter = Google::APIClient::JWTAsserter.new(c('client_developer_email'), @scope, key)

      begin
        @client.authorization = asserter.authorize()
        @api = @client.discovered_api(@name_api, @version_api)
      rescue
        return false
      end

      return true
    end
def login_by_cert
      @client = Google::APIClient.new

      key      = Google::APIClient::PKCS12.load_key(c('client_cert_file'), c('key_secret'))
      asserter = Google::APIClient::JWTAsserter.new(c('client_developer_email'), @scope, key)

      begin
        @client.authorization = asserter.authorize()
        @api = @client.discovered_api(@name_api, @version_api)
      rescue
        return false
      end

      return true
    end
Login using cert file (Service account)

   Required: client_cert_file, client_developer_email, key_secret

   Success: return true
   Failure: return false