diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/shortmessage/utils/RSA.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/shortmessage/utils/RSA.java index 4fe3e5d..a5fddca 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/shortmessage/utils/RSA.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/shortmessage/utils/RSA.java @@ -1,6 +1,7 @@ package com.chinaunicom.mall.ebtp.extend.shortmessage.utils; import com.chinaunicom.mall.ebtp.common.exception.common.CommonExceptionEnum; +import lombok.extern.slf4j.Slf4j; import javax.crypto.Cipher; import java.security.*; @@ -11,7 +12,7 @@ import java.security.spec.X509EncodedKeySpec; import java.util.Base64; import java.util.HashMap; import java.util.Map; - +@Slf4j public class RSA { public static final String KEY_ALGORITHM = "RSA"; @@ -272,6 +273,7 @@ public class RSA { String v = encryptBASE64(RSA.encryptByPublicKey(value.getBytes(), publicKey)); return v; }catch (Exception e){ + log.error("加密异常",e); CommonExceptionEnum.FRAME_EXCEPTION_COMMON_DATA_OTHER_ERROR.customValidName("加密异常", true); } return ""; diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/service/impl/WpsServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/service/impl/WpsServiceImpl.java index 0c0c09c..ae933fa 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/service/impl/WpsServiceImpl.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/service/impl/WpsServiceImpl.java @@ -528,10 +528,13 @@ public class WpsServiceImpl implements WpsService { String time = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")); //fileId+ebtp+token+time md5加密 String mdKey = MdConstants.getSha256(time+fileId+appName+token); + log.info("mdKey:"+mdKey); //fileId|token|yyyyMMddHHmmss|md5加密 String rsaKey = fileId+"|"+token+"|"+time+"|"+mdKey; + log.info("rsaKey:"+rsaKey); //RSA加密 String key = RSA.encrypt(rsaKey,kswpublicKey); + log.info("key:"+key); return key; }