// 1. Build parameter
HashMap<String, Object> data = new HashMap<>(3);
data.put("appId", "4D19348CCFB71BE1ACC457C02259B45B");
data.put("appSecret", "91715E74D4CE8555C84E96D59EB34B50");
// 2. Add timestamp
data.put("timestamp", System.currentTimeMillis());
// 3. Serialization parameter
String json = JSONUtil.toJsonStr(data);
// 4. Use public key encryption to get the encrypted string
RSA rsa = new RSA(null, "PublicKeyStr");
byte[] encrypt = rsa.encrypt(json, KeyType.PublicKey);
String code = Base64.encode(encrypt);