// 1. 构建需要参数
HashMap<String, Object> data = new HashMap<>(3);
data.put("appId", "4D19348CCFB71BE1ACC457C02259B45B");
data.put("appSecret", "91715E74D4CE8555C84E96D59EB34B50");
// 2. 添加时间戳
data.put("timestamp", System.currentTimeMillis());
// 3. 序列化参数
String json = JSONUtil.toJsonStr(data);
// 4. 使用公钥加密得到加密串
RSA rsa = new RSA(null, "PublicKeyStr");
byte[] encrypt = rsa.encrypt(json, KeyType.PublicKey);
String code = Base64.encode(encrypt);