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;
    }
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;
    }
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 ; }
Fetch x509 cert for RS256 token decoding.

@param string      $jwks_url URL to the JWKS.
@param string|null $kid      Key ID to use; returns first JWK if $kid is null or empty.

@return string|null - Null if an x5c key could not be found for a key ID or if the JWKS is empty/invalid.
Fetch x509 cert for RS256 token decoding .