mirror of
https://gitee.com/egzosn/pay-java-parent.git
synced 2026-05-22 18:11:39 +08:00
签名工具优化
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package com.egzosn.pay.common.util.sign;
|
||||
|
||||
import com.egzosn.pay.common.bean.result.PayException;
|
||||
import com.egzosn.pay.common.exception.PayErrorException;
|
||||
import com.egzosn.pay.common.util.sign.encrypt.sm3.SM3Digest;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
@@ -91,7 +93,7 @@ public class SecureUtil {
|
||||
try {
|
||||
bytes = digestByData(data.getBytes(encoding),ALGORITHM_SHA1);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
throw new PayErrorException(new PayException("error", e.getLocalizedMessage()));
|
||||
}
|
||||
StringBuilder sha256StrBuff = new StringBuilder();
|
||||
for (int i = 0; i < bytes.length; i++) {
|
||||
|
||||
@@ -230,7 +230,7 @@ public enum SignUtils {
|
||||
if ("".equals(value)){ continue;}
|
||||
valueStr += (i == values.length - 1) ? value : value + ",";
|
||||
}
|
||||
} else if (o != null) {
|
||||
} else {
|
||||
valueStr = o.toString();
|
||||
}
|
||||
if (null == valueStr || "".equals(valueStr.toString().trim()) || (null != ignoreKey && Arrays.binarySearch(ignoreKey, k ) >= 0)) {
|
||||
|
||||
Reference in New Issue
Block a user