private static Optional<RsaJsonWebKey> findRsaJsonWebKey(final List<JsonWebKey> keys, final Predicate<JsonWebKey> filter) {
        return keys
            .stream()
            .filter(key -> key instanceof RsaJsonWebKey && filter.test(key))
            .map(RsaJsonWebKey.class::cast)
            .findFirst();
    }
This is {@link JsonWebKeySetStringCipherExecutor}.

@author Misagh Moayyed
@since 5.3.0
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/cipher/JsonWebKeySetStringCipherExecutor.java