def fetch_xrds(authority, url, cache=true)
      return if url.nil?

      cached_xrds = get_cache(url)
      return cached_xrds unless cached_xrds.nil?

      http_resp = OpenID.fetch(url)
      return if http_resp.code != "200" and http_resp.code != "206"

      body = http_resp.body
      signature = http_resp["Signature"]
      signed_by = SimpleSign.verify(body, signature)
      if !signed_by.casecmp(authority) or !signed_by.casecmp('hosted-id.google.com')
        return false # Signed, but not by the right domain.
      end


      # Everything is OK
      if cache
        put_cache(url, body)
      end
      return body
    end
def fetch_xrds(authority, url, cache=true)
      return if url.nil?

      cached_xrds = get_cache(url)
      return cached_xrds unless cached_xrds.nil?

      http_resp = OpenID.fetch(url)
      return if http_resp.code != "200" and http_resp.code != "206"

      body = http_resp.body
      signature = http_resp["Signature"]
      signed_by = SimpleSign.verify(body, signature)
      if !signed_by.casecmp(authority) or !signed_by.casecmp('hosted-id.google.com')
        return false # Signed, but not by the right domain.
      end


      # Everything is OK
      if cache
        put_cache(url, body)
      end
      return body
    end
Fetches the XRDS and verifies the signature and authority for the doc