public function requestJwkX5c($jwks_url, $kid = null)
    {
        $cache_key = $jwks_url.'|'.$kid;

        $x5c = $this->cache->get($cache_key);
        if (! is_null($x5c)) {
            return $x5c;
        }

        $jwks = $this->requestJwks($jwks_url);
        $jwk  = $this->findJwk($jwks, $kid);

        if ($this->subArrayHasEmptyFirstItem($jwk, 'x5c')) {
            return null;
        }

        $x5c = $this->convertCertToPem($jwk['x5c'][0]);
        $this->cache->set($cache_key, $x5c);
        return $x5c;
    }