private static JsonWebKeySet getJsonWebKeysFromJwks(final JsonWebKeySet jwks,
                                                        final OidcJsonWebKeyCacheKey cacheKey) {
        val keys = OidcJsonWebKeyStoreUtils.getJsonWebKeyFromJsonWebKeySet(jwks,
                Optional.empty(), Optional.of(cacheKey.getUsage()))
            .map(JsonWebKeySet::getJsonWebKeys)
            .orElseGet(ArrayList::new);
        return new JsonWebKeySet(keys
            .stream()
            .filter(key -> OidcJsonWebKeystoreRotationService.JsonWebKeyLifecycleStates.getJsonWebKeyState(key).isCurrent())
            .map(PublicJsonWebKey.class::cast)
            .filter(key -> key.getPrivateKey() != null)
            .collect(Collectors.toList()));
    }
Gets json web key from jwks.

@param jwks     the jwks
@param cacheKey the cache key
@return the json signing web key from jwks
support/cas-server-support-oidc-core-api/src/main/java/org/apereo/cas/oidc/jwks/OidcDefaultJsonWebKeystoreCacheLoader.java