@Override
    public Key resolveKey(JsonWebSignature jws, List<JsonWebStructure> nestingContext) throws UnresolvableKeyException {
        if (!isInitialized)
            throw new IllegalStateException("Please call init() first");

        try {
            List<JsonWebKey> jwks = refreshingHttpsJwks.getJsonWebKeys();
            JsonWebKey jwk = verificationJwkSelector.select(jws, jwks);

            if (jwk != null)
                return jwk.getKey();

            String keyId = jws.getKeyIdHeaderValue();

            if (refreshingHttpsJwks.maybeExpediteRefresh(keyId))
                log.debug("Refreshing JWKs from {} as no suitable verification key for JWS w/ header {} was found in {}", refreshingHttpsJwks.getLocation(), jws.getHeaders().getFullHeaderAsJsonString(), jwks);

            String sb = "Unable to find a suitable verification key for JWS w/ header " + jws.getHeaders().getFullHeaderAsJsonString() +
                    " from JWKs " + jwks + " obtained from " +
                    refreshingHttpsJwks.getLocation();
            throw new UnresolvableKeyException(sb);
        } catch (JoseException | IOException e) {
            String sb = "Unable to find a suitable verification key for JWS w/ header " + jws.getHeaders().getFullHeaderAsJsonString() +
                    " due to an unexpected exception (" + e + ") while obtaining or using keys from JWKS endpoint at " +
                    refreshingHttpsJwks.getLocation();
            throw new UnresolvableKeyException(sb, e);
        }
    }
<code>RefreshingHttpsJwksVerificationKeyResolver</code> is a
{@link VerificationKeyResolver} implementation that will periodically refresh the
JWKS using its {@link HttpsJwks} instance.

A <a href="https://datatracker.ietf.org/doc/html/rfc7517#section-5">JWKS (JSON Web Key Set)</a>
is a JSON document provided by the OAuth/OIDC provider that lists the keys used to sign the JWTs
it issues.

Here is a sample JWKS JSON document:

<pre>
{
  "keys": [
    {
      "kty": "RSA",
      "alg": "RS256",
      "kid": "abc123",
      "use": "sig",
      "e": "AQAB",
      "n": "..."
    },
    {
      "kty": "RSA",
      "alg": "RS256",
      "kid": "def456",
      "use": "sig",
      "e": "AQAB",
      "n": "..."
    }
  ]
}
</pre>

Without going into too much detail, the array of keys enumerates the key data that the provider
is using to sign the JWT. The key ID (<code>kid</code>) is referenced by the JWT's header in
order to match up the JWT's signing key with the key in the JWKS. During the validation step of
the broker, the jose4j OAuth library will use the contents of the appropriate key in the JWKS
to validate the signature.

Given that the JWKS is referenced by the JWT, the JWKS must be made available by the
OAuth/OIDC provider so that a JWT can be validated.

@see CloseableVerificationKeyResolver
@see VerificationKeyResolver
@see RefreshingHttpsJwks
@see HttpsJwks
clients/src/main/java/org/apache/kafka/common/security/oauthbearer/internals/secured/RefreshingHttpsJwksVerificationKeyResolver.java