code: public static Optional<Key> buildRSAPublicKey(final String keyType, final BigInteger modulus,
              final BigInteger exponent) {
          try {
              return of(KeyFactory.getInstance(keyType).generatePublic(new RSAPublicKeySpec(modulus, exponent)));
          } catch (final NoSuchAlgorithmException | InvalidKeySpecException ex) {
              LOGGER.error("Error generating RSA Key from JWKS entry", ex);
          }
          return empty();
      }
docs: Build an RSA public key.
  @param keyType the algorithm (should be "RSA")
  @param modulus the modulus
  @param exponent the exponent
  @return an RSA public key, if one could be successfully generated