SM2加密请求体通过HTTP传输


小结

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);

文章作者: fejxc
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 fejxc !
评论
  目录