code: private PublicKey getPublicKey(String MODULUS, String EXPONENT) {
          byte[] nb = base64UrlDecodeToBytes(MODULUS);
          byte[] eb = base64UrlDecodeToBytes(EXPONENT);
          BigInteger n = new BigInteger(1, nb);
          BigInteger e = new BigInteger(1, eb);
  
          RSAPublicKeySpec rsaPublicKeySpec = new RSAPublicKeySpec(n, e);
          try {
              PublicKey publicKey = KeyFactory.getInstance("RSA").generatePublic(rsaPublicKeySpec);
              return publicKey;
          } catch (Exception ex) {
              logger.error("Exception while getting public key ", ex);
              throw new RuntimeException("Cant create public key", ex);
          }
      }
docs: Build public key
  
  @param MODULUS
  @param EXPONENT
  @return