WANG 6 vuotta sitten
vanhempi
commit
1a329d2e98
1 muutettua tiedostoa jossa 6 lisäystä ja 1 poistoa
  1. 6 1
      src/main/java/cn/com/qmth/examcloud/commons/util/AES.java

+ 6 - 1
src/main/java/cn/com/qmth/examcloud/commons/util/AES.java

@@ -14,6 +14,8 @@ import org.apache.commons.codec.binary.Hex;
 import org.apache.commons.lang3.StringUtils;
 
 import cn.com.qmth.examcloud.commons.exception.ExamCloudRuntimeException;
+import cn.com.qmth.examcloud.commons.logging.ExamCloudLog;
+import cn.com.qmth.examcloud.commons.logging.ExamCloudLogFactory;
 
 /**
  * AES算法<br>
@@ -25,6 +27,9 @@ import cn.com.qmth.examcloud.commons.exception.ExamCloudRuntimeException;
  * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
  */
 public class AES {
+
+	private static final ExamCloudLog LOG = ExamCloudLogFactory.getLog(AES.class);
+
 	private static final String KEY_ALGORITHM = "AES";
 
 	private static final String CIPHER_ALGORITHM_CBC = "AES/CBC/PKCS5Padding";
@@ -66,7 +71,7 @@ public class AES {
 			encryptCipher.init(Cipher.ENCRYPT_MODE, secretKey, new IvParameterSpec(iv));
 			decryptCipher.init(Cipher.DECRYPT_MODE, secretKey, new IvParameterSpec(iv));
 		} catch (GeneralSecurityException e) {
-			e.printStackTrace();
+			LOG.error("fail to new instance of AES.", e);
 		}
 	}