def METHOD_NAME(self, kid):
    # retrieve keys from jwks_url
    resp = self.request(self.jwks_url(), method="GET")
    resp.raise_for_status()
    # find the proper key for the kid
    for key in resp.json()["keys"]:
        if key["kid"] == kid:
            x5c = key["x5c"][0]
            break
    else:
        raise DecodeError(f"Cannot find kid={kid}")
    return load_der_x509_certificate(base64.b64decode(x5c), default_backend())