|
|
@@ -3,6 +3,7 @@ package com.malk.lianan;
|
|
|
import cn.hutool.core.codec.Base64;
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
|
import cn.hutool.core.util.CharsetUtil;
|
|
|
+import cn.hutool.core.util.IdUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.crypto.Mode;
|
|
|
import cn.hutool.crypto.Padding;
|
|
|
@@ -111,7 +112,7 @@ public class TestUtil {
|
|
|
head.put("Timestamp", UtilDateTime.getLocalDateTimeTimeStamp());
|
|
|
head.put("SystemNo",GYPAY_API_SYS_ID);
|
|
|
head.put("SystemName",GYPAY_API_SYS_NAME);
|
|
|
- head.put("RequestNo","12150007");
|
|
|
+ head.put("RequestNo", IdUtil.nanoId(6));
|
|
|
Map<String,Object> body = new HashMap<>();
|
|
|
Map<String,Object> item = new HashMap<>();
|
|
|
item.put("AcctNo",GYPAY_API_ACCOUNT_NO);
|
|
|
@@ -164,12 +165,12 @@ public class TestUtil {
|
|
|
item.put("NextTag",1);
|
|
|
|
|
|
Map<String,Object> data = UtilMap.map("ParamSet", Arrays.asList(item));
|
|
|
- System.out.println(JSON.toJSONString(data));
|
|
|
- String encrypt = AesUtil.encrypt(JSON.toJSONString(data),GYPAY_API_AES_KEY);
|
|
|
+ String dataStr = JSON.toJSONString(data);
|
|
|
+ System.out.println(dataStr);
|
|
|
+ String encrypt = AesUtil.encrypt(dataStr,GYPAY_API_AES_KEY);
|
|
|
log.info("encrypt:{},{}","",encrypt);
|
|
|
- //解密
|
|
|
body.put("Data", encrypt);
|
|
|
- String signed=RSASignatureUtil.signSafe(encrypt,GYPAY_API_PRI_KEY);
|
|
|
+ String signed=RsaUtil.sign(dataStr.getBytes(),GYPAY_API_PRI_KEY);
|
|
|
body.put("Sign", signed);
|
|
|
|
|
|
Map<String,Object> Cmscloud = new HashMap<>();
|