private void generateCurrentKeys(final JsonWebKeySet jsonWebKeySet) {
        val foundCurrent = jsonWebKeySet.getJsonWebKeys()
            .stream().anyMatch(key -> JsonWebKeyLifecycleStates.getJsonWebKeyState(key).isCurrent());
        if (!foundCurrent) {
            val currentKeySigning = OidcJsonWebKeystoreGeneratorService.generateJsonWebKey(oidcProperties, OidcJsonWebKeyUsage.SIGNING);
            JsonWebKeyLifecycleStates.setJsonWebKeyState(currentKeySigning, JsonWebKeyLifecycleStates.CURRENT);
            LOGGER.trace("Generated current signing key with id [{}]", currentKeySigning.getKeyId());
            jsonWebKeySet.addJsonWebKey(currentKeySigning);

            val currentKeyEncryption = OidcJsonWebKeystoreGeneratorService.generateJsonWebKey(oidcProperties, OidcJsonWebKeyUsage.ENCRYPTION);
            JsonWebKeyLifecycleStates.setJsonWebKeyState(currentKeyEncryption, JsonWebKeyLifecycleStates.CURRENT);
            LOGGER.trace("Generated current encryption key with id [{}]", currentKeyEncryption.getKeyId());
            jsonWebKeySet.addJsonWebKey(currentKeyEncryption);
        }
    }
This is {@link OidcDefaultJsonWebKeystoreRotationService}.

@author Misagh Moayyed
@since 6.5.0
support/cas-server-support-oidc-core-api/src/main/java/org/apereo/cas/oidc/jwks/rotation/OidcDefaultJsonWebKeystoreRotationService.java