添加rsa

This commit is contained in:
xiangwb
2017-11-20 17:04:10 +08:00
parent 5f1fcea677
commit 737ba5223c
5 changed files with 296 additions and 0 deletions
@@ -4,10 +4,12 @@ import com.alibaba.fastjson.JSONObject;
import com.xwbing.annotation.LogInfo;
import com.xwbing.domain.entity.ExpressInfo;
import com.xwbing.domain.entity.vo.ExpressInfoVo;
import com.xwbing.exception.BusinessException;
import com.xwbing.redis.RedisService;
import com.xwbing.service.ExpressDeliveryService;
import com.xwbing.service.QRCodeZipService;
import com.xwbing.util.JSONObjResult;
import com.xwbing.util.RSAUtil;
import com.xwbing.util.RestMessage;
import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils;
@@ -94,4 +96,16 @@ public class TestControl {
RestMessage restMessage = qrCodeZipService.batchGetImage(response, names, fileName);
return JSONObjResult.toJSONObj(restMessage);
}
@LogInfo("rsa")
@GetMapping("rsa")
public void rsa() {
try {
String en = RSAUtil.encrypt("123456");
String de = RSAUtil.decrypt(en);
System.out.println(de);
} catch (Exception ex) {
throw new BusinessException(ex.getMessage());
}
}
}