小结
AES+SM2 混合加密思想
参考:https://blog.csdn.net/qq_35229064/article/details/51883959
// JSON请求参数
String dataJson= JsonObjectUtil.converObjectTojson(sjgjdataList);//JSON.toJSONString(proinstPageRequest)
//SM2请求模型
GenericSm2ParamsRequest sm2ParamsRequest=GenericSm2ParamsRequest.builder().pid("1").qxdm(applicattionProperties.getQxdm()).fwqbm(applicattionProperties.getFwqbm()).data(dataJson).timestamp(System.currentTimeMillis()).build();
//使用SM2加密请求参数
//AES密钥用Sm2公钥加密
Sm2ParamsDo sm2ParamsDo= Sm2ParamsUtils.getEncryptSm2ParamsDataByKey(commonProperties.getSm2UserId(),sm2ParamsRequest,commonProperties.getSm2PublicKey());
dataJson= JsonObjectUtil.converObjectTojson(sm2ParamsDo);
StopWatch stopwatch = StopWatch.createStarted();
String serviceUrl=senderProperties.getProduceQuartz().getNextReceiverHttpUrl()+"/rec/sjgj/ save/data/batch";
String result = RestUtils.post(serviceUrl, dataJson);