JWKSelector selector = new JWKSelector();
Set<KeyOperation> ops = new HashSet<>(Arrays.asList(KeyOperation.SIGN, null));
selector.setKeyOperations(ops);
List<JWK> keyList = new ArrayList<>();
keyList.add(new RSAKey.Builder(new Base64URL("n"), new Base64URL("e")).keyID("1")
.keyOperations(new HashSet<>(Arrays.asList(KeyOperation.SIGN))).build());
keyList.add(new ECKey.Builder(ECKey.Curve.P_256, new Base64URL("x"), new Base64URL("y")).keyID("2").build());
keyList.add(new ECKey.Builder(ECKey.Curve.P_256, new Base64URL("x"), new Base64URL("y")).keyID("3")
.keyOperations(new HashSet<>(Arrays.asList(KeyOperation.ENCRYPT))).build());
JWKSet jwkSet = new JWKSet(keyList);
List<JWK> matches = selector.select(jwkSet);