private static Optional<JsonWebKeySet> buildJsonWebKeySet(final Resource resource,
                                                              final Optional<String> keyId,
                                                              final Optional<OidcJsonWebKeyUsage> usage) throws Exception {
        LOGGER.debug("Loading JSON web key from [{}]", resource);
        try (val is = resource.getInputStream()) {
            val json = IOUtils.toString(is, StandardCharsets.UTF_8);
            LOGGER.debug("Retrieved JSON web key from [{}] as [{}]", resource, json);
            return buildJsonWebKeySet(json, keyId, usage);
        }
    }
Gets json web key from jwks.

@param jwks         the jwks
@param requestedKey the kid
@param usage        the usage
@return the json web key from jwks
support/cas-server-support-oidc-core-api/src/main/java/org/apereo/cas/oidc/jwks/OidcJsonWebKeyStoreUtils.java