Explorar el Código

银行mq解密

linbl hace 1 año
padre
commit
886ab8b9ef

+ 2 - 1
sp-service/payment-server/src/main/java/com/pj/task/BankByteTask.java

@@ -11,6 +11,7 @@ import com.pj.bank_info_charges.BankInfoCharges;
 import com.pj.bank_info_charges.BankInfoChargesService;
 import com.pj.common.core.utils.StringUtils;
 import com.pj.enummj.FinishStatus;
+import com.pj.utils.CryptoUtil;
 import com.pj.utils.ht.AESUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Configuration;
@@ -77,7 +78,7 @@ public class BankByteTask {
         byteList.forEach(item -> {
             String body = item.getBody();
             //数据解析
-            String xmlStr = body;//AESUtil.decryptCBC(body, RabbitMQOne.ACC_KEY);
+            String xmlStr = CryptoUtil.decrypt(body);
 
             BankInfo bankInfo = new BankInfo();
             List<BankInfoCharges> chargesList = new ArrayList<>();

+ 4 - 0
sp-service/payment-server/src/main/java/com/pj/utils/CryptoUtil.java

@@ -50,6 +50,10 @@ public class CryptoUtil {
         return encrypt(m,sm4Key);
     }
 
+    public static String decrypt(String m) {
+        return decrypt(m,sm4Key);
+    }
+
     public static String encrypt(String m,String sm4Key) {
         logger.info("原文: {}", m);
         Encoder encoder = Encoder.Hex;