周箭河 5 роки тому
батько
коміт
79bde32c3e

+ 27 - 48
mec-biz/src/main/java/com/ym/mec/biz/service/PayService.java

@@ -1,6 +1,8 @@
 package com.ym.mec.biz.service;
 
 
+import com.ym.mec.thirdparty.union.H5;
+import com.ym.mec.thirdparty.union.UnionPay;
 import com.ym.mec.thirdparty.yqpay.YqPayUtil;
 import org.springframework.core.io.ClassPathResource;
 import org.springframework.stereotype.Service;
@@ -12,57 +14,34 @@ import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 
-/** 
- * 上传工具服务层实现
+/**
+ * 支付服务
  */
 @Service
 public class PayService {
 
-	/**
-	 * 返回订单提交数据
-	 * @param amount 金额
-	 * @param orderNo 订单编号
-	 * @param notifyUrl 异步通知地址
-	 * @param returnUrl 支付返回地址
-	 * @param orderSubject 订单标题
-	 * @param orderBody 订单内容
-	 * @return
-	 * @throws Exception
-	 */
-	public Map getPayMap(BigDecimal amount, String orderNo, String notifyUrl, String returnUrl, String orderSubject, String orderBody) throws Exception {
-
-//        String notifyUrl = ""; //异步通知地址
-//        String returnUrl = ""; //还回地址
-//        String orderBody = "大雅乐盟培训课程";//订单内容
-//        String orderSubject = "培训订单";//订单标题
-//        String orderNo = "2019121263844";//订单编号
-//        BigDecimal amount = new BigDecimal("6543"); //订单金额
-
-		String payUrl = "https://qyfapi.95epay.com/api/api/hPay/toPayHtml";//支付提交地址
-		String payChannels = "{\"weChatPay\":true,\"weChatPayMobile\":false,\"aliPay\":true,\"fastpayXy\":true,\"aliPayMobile\":false,\"balancePay\":false}";//支付方式配置
-
-		//List<Map> tempRoutingList = new ArrayList();
-//        Map<String, Object> routingList = new HashMap<>();
-//        routingList.put("routingMerNo", routingAccount.getSellerNo());//分佣账户
-////      routingList.put("routingFee", order.getAmount()); //分佣金额
-//        routingList.put("routingFee", order.getAmount().subtract((order.getAmount().multiply(new BigDecimal(0.28)).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_UP))); //分佣金额
-//        tempRoutingList.add(routingList);
-//
-
-		Map<String, Object> resultMap = new LinkedHashMap<String, Object>();
-		resultMap.put("sellerNo", "0021677"); //收款商户号
-		resultMap.put("payChannels", payChannels); //支付方式
-		resultMap.put("orderBody", orderBody); //订单信息
-		resultMap.put("payAmount", amount); //支付金额
-		resultMap.put("apiPayType", "1"); //*API支付类型1-即时支付,2-担保支付,3-预授权支付*/
-		resultMap.put("tradeType", "0"); //*交易类型1—充值,0—收款*
-		resultMap.put("merMerOrderNo", orderNo); //商户订单号
-		resultMap.put("orderSubject", orderSubject); //订单标题
-		resultMap.put("returnUrl", returnUrl); //前台页面地址
-		//resultMap.put("tempRoutingList", JSON.toJSONString(tempRoutingList));//分账设置
-		Map rqMap = new YqPayUtil(notifyUrl, resultMap).getRequestMap();
-		rqMap.put("host", payUrl);
-		return rqMap;
-	}
+    /**
+     * 返回订单提交数据
+     *
+     * @param amount       金额
+     * @param orderNo      订单编号
+     * @param notifyUrl    异步通知地址
+     * @param returnUrl    支付返回地址
+     * @param orderSubject 订单标题
+     * @param orderBody    订单内容
+     * @return
+     * @throws Exception
+     */
+    public Map getPayMap(BigDecimal amount, String orderNo, String notifyUrl, String returnUrl, String orderSubject, String orderBody) throws Exception {
+        String routingMerNo = "006718";
+
+        //支付通道决策
+
+        //易乾支付
+        YqPayUtil.getPayMap(amount, orderNo, notifyUrl, returnUrl, orderSubject, orderBody, routingMerNo);
+
+        return UnionPay.getPayMap(amount, orderNo, notifyUrl, returnUrl, orderSubject);
+
+    }
 
 }

+ 24 - 0
mec-client-api/src/main/java/com/ym/mec/im/YqPayService.java

@@ -0,0 +1,24 @@
+package com.ym.mec.im;
+
+import com.ym.mec.thirdparty.yqpay.Msg;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.Map;
+
+@FeignClient(value = "yqPay", url = "${yq-pay.pay-host}")
+public interface YqPayService {
+    @RequestMapping(name = "统一下单",value = "/api/api/pay/toPay", method= RequestMethod.POST)
+    Msg toPay(@RequestParam Map<String, Object> map);
+
+    @RequestMapping(name = "平台转账",value = "/api/api/platformTransfer/toAcc", method= RequestMethod.POST)
+    String platformTransferAcc(@RequestParam Map<String, Object> map);
+
+    @RequestMapping(name = "提现",value = "/api/api/withdraw/intfc", method= RequestMethod.POST)
+    Msg intfc(@RequestParam Map<String, Object> map);
+
+    @RequestMapping(name = "发送验证码",value = "/api/api/withdraw/sendSms", method= RequestMethod.POST)
+    Msg sendSms(@RequestParam Map<String, Object> map);
+}

+ 19 - 13
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/union/H5.java

@@ -2,13 +2,12 @@ package com.ym.mec.thirdparty.union;
 
 import com.alibaba.fastjson.JSONObject;
 
-import java.io.ByteArrayInputStream;
-import java.net.URLDecoder;
 import java.net.URLEncoder;
 import java.security.InvalidKeyException;
 import java.security.NoSuchAlgorithmException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.Map;
 import java.util.UUID;
 
 import javax.crypto.Mac;
@@ -32,6 +31,9 @@ import org.apache.http.util.EntityUtils;
 public class H5 {
     static String appId = "10037e6f6a4e6da4016a670fd4530012";
     static String appKey = "f7a74b6c02ae4e1e94aaba311c04acf2";
+    static String mid = "898310148160568";
+    static String tid = "88880001";
+
     static String timestamp = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
     static String nonce = UUID.randomUUID().toString().replace("-", "");
 
@@ -43,19 +45,19 @@ public class H5 {
     }
 
     public static String getOpenBodySigForNetpay(String appId, String appKey, String timestamp, String nonce, String content) throws Exception {
-        String bodyDigest = DigestUtils.sha256Hex(content);
-        String str1_C = appId + timestamp + nonce + bodyDigest;
-        byte[] localSignature = hmacSHA256(str1_C.getBytes(), appKey.getBytes());
+        String signatureStr = appId + timestamp + nonce + DigestUtils.sha256Hex(content);
+        byte[] localSignature = hmacSHA256(signatureStr.getBytes(), appKey.getBytes());
         return ("authorization=OPEN-FORM-PARAM" + "&appId=" + appId + "&timestamp=" + timestamp + "&nonce=" + nonce + "&content=" + URLEncoder.encode(content, "UTF-8") + "&signature=" + URLEncoder.encode(Base64.encodeBase64String(localSignature), "UTF-8"));
     }
 
-    public static void main(String[] args) throws Exception {
+
+    public static String getRequestMap() throws Exception {
         JSONObject json = new JSONObject();
 
         json.put("instMid", "H5DEFAULT");
-        json.put("mid", "898310148160568");
-        json.put("tid", "88880001");
-        json.put("totalAmount", 20000);
+        json.put("mid", mid);
+        json.put("tid", tid);
+        json.put("totalAmount", "20000");
 
         json.put("orderDesc", "大雅乐盟培训课程");
         // json.put("bizType", "B2B");
@@ -63,11 +65,15 @@ public class H5 {
         json.put("requestTimestamp", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
         json.put("returnUrl", "http://dev.dayaedu.com");
 
-
         String param = getOpenBodySigForNetpay(appId, appKey, timestamp, nonce, json.toString());
-        System.out.println("http://58.247.0.18:29015/v1/netpay/trade/h5-pay?" + param);
-//        GetOpenBodySig.sendGet("http://58.247.0.18:29015/v1/netpay/webpay/pay?"+param);
-        System.out.println(json.toString());
+        return "http://58.247.0.18:29015/v1/netpay/trade/h5-pay?" + param;
+    }
+
+
+    public static void main(String[] args) throws Exception {
+
+        System.out.println(getRequestMap());
+
     }
 }
 

+ 2 - 3
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/union/Mp.java

@@ -32,9 +32,8 @@ public class Mp {
     }
 
     public static String getOpenBodySigForNetpay(String appId, String appKey, String timestamp, String nonce, String content) throws Exception {
-        String bodyDigest = DigestUtils.sha256Hex(content);
-        String str1_C = appId + timestamp + nonce + bodyDigest;
-        byte[] localSignature = hmacSHA256(str1_C.getBytes(), appKey.getBytes());
+        String signatureStr = appId + timestamp + nonce + DigestUtils.sha256Hex(content);
+        byte[] localSignature = hmacSHA256(signatureStr.getBytes(), appKey.getBytes());
         return ("authorization=OPEN-FORM-PARAM" + "&appId=" + appId + "&timestamp=" + timestamp + "&nonce=" + nonce + "&content=" + URLEncoder.encode(content, "UTF-8") + "&signature=" + URLEncoder.encode(Base64.encodeBase64String(localSignature), "UTF-8"));
     }
 

+ 0 - 64
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/union/Qrcode.java

@@ -1,64 +0,0 @@
-package com.ym.mec.thirdparty.union;
-
-import com.alibaba.fastjson.JSONObject;
-import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.codec.digest.DigestUtils;
-import org.apache.commons.lang.RandomStringUtils;
-import org.apache.commons.lang.time.DateFormatUtils;
-
-import javax.crypto.Mac;
-import javax.crypto.spec.SecretKeySpec;
-import java.net.URLEncoder;
-import java.security.InvalidKeyException;
-import java.security.NoSuchAlgorithmException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.UUID;
-
-/**
- * 银联商务主扫
- */
-public class Qrcode {
-    static String appId = "10037e6f66f2d0f901672aa27d690006";
-    static String appKey = "47ace12ae3b348fe93ab46cee97c6fde";
-    static String timestamp = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
-    static String nonce = UUID.randomUUID().toString().replace("-", "");
-
-    public static byte[] hmacSHA256(byte[] data, byte[] key) throws InvalidKeyException, NoSuchAlgorithmException {
-        String algorithm = "HmacSHA256";
-        Mac mac = Mac.getInstance(algorithm);
-        mac.init(new SecretKeySpec(key, algorithm));
-        return mac.doFinal(data);
-    }
-
-    public static String getOpenBodySigForNetpay(String appId, String appKey, String timestamp, String nonce, String content) throws Exception {
-        //String bodyDigest = DigestUtils.sha256Hex(URLDecoder.decode(content, "UTF-8"));
-        String bodyDigest = DigestUtils.sha256Hex(content);
-        System.out.println(bodyDigest);
-        String str1_C = appId + timestamp + nonce + bodyDigest;
-        byte[] localSignature = hmacSHA256(str1_C.getBytes(), appKey.getBytes());
-        return ("authorization=OPEN-FORM-PARAM" + "&appId=" + appId + "&timestamp=" + timestamp + "&nonce=" + nonce + "&content=" + URLEncoder.encode(content, "UTF-8") + "&signature=" + URLEncoder.encode(Base64.encodeBase64String(localSignature), "UTF-8"));
-    }
-
-    public static void main(String[] args) throws Exception {
-        JSONObject json = new JSONObject();
-
-        json.put("instMid", "QRPAYDEFAULT");
-        json.put("mid", "898460107420248");
-        json.put("tid", "88880001");
-        json.put("totalAmount", 20000);
-
-        json.put("orderDesc", "345");
-        // json.put("bizType", "B2B");
-        json.put("merOrderId", "1017" + new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date()) + RandomStringUtils.randomNumeric(7));
-        json.put("requestTimestamp", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
-        json.put("returnUrl","http://dev.dayaedu.com");
-
-
-        String param = getOpenBodySigForNetpay(appId, appKey, timestamp, nonce, json.toString());
-        System.out.println("http://58.247.0.18:29015/v1/netpay/webpay/pay?" + param);
-//        GetOpenBodySig.sendGet("http://58.247.0.18:29015/v1/netpay/webpay/pay?"+param);
-        System.out.println(json.toString());
-    }
-}
-

+ 126 - 0
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/union/UnionPay.java

@@ -0,0 +1,126 @@
+package com.ym.mec.thirdparty.union;
+
+import com.alibaba.fastjson.JSONObject;
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang.time.DateFormatUtils;
+
+import javax.crypto.Mac;
+import javax.crypto.spec.SecretKeySpec;
+import java.math.BigDecimal;
+import java.net.URLEncoder;
+import java.security.InvalidKeyException;
+import java.security.NoSuchAlgorithmException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+/**
+ * 银联商务主扫
+ */
+public class UnionPay {
+    static String aliPayUrl = "http://58.247.0.18:29015/v1/netpay/trade/h5-pay";//支付宝
+    static String qmfPayUrl = "http://58.247.0.18:29015/v1/netpay/qmf/h5-pay";//银联无卡
+    static String H5AppId = "10037e6f6a4e6da4016a670fd4530012";
+    static String h5AppKey = "f7a74b6c02ae4e1e94aaba311c04acf2";
+    static String h5Mid = "898310148160568";
+    static String h5Tid = "88880001";
+
+    static String wpPayUrl = "http://58.247.0.18:29015/v1/netpay/webpay/pay";//微信
+    static String wpAppId = "10037e6f6a4e6da4016a62a47e51000c";
+    static String wpAppKey = "b4b70d123a724972bc21f445b0b9f75c";
+    static String wpMid = "898460107420248";
+    static String wpTid = "00000001";
+
+    static String queryUrl = "http://58.247.0.18:29015/v1/netpay/query"; //订单查询地址
+
+    static String timestamp = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
+    static String nonce = UUID.randomUUID().toString().replace("-", "");
+
+    private static byte[] hmacSHA256(byte[] data, byte[] key) throws InvalidKeyException, NoSuchAlgorithmException {
+        String algorithm = "HmacSHA256";
+        Mac mac = Mac.getInstance(algorithm);
+        mac.init(new SecretKeySpec(key, algorithm));
+        return mac.doFinal(data);
+    }
+
+    private static String getOpenBodySig(String appId, String appKey, String timestamp, String nonce, String content, String method) throws Exception {
+        String signatureStr = appId + timestamp + nonce + DigestUtils.sha256Hex(content);
+        byte[] localSignature = hmacSHA256(signatureStr.getBytes(), appKey.getBytes());
+        if (method.toUpperCase().equals("POST")) {
+            return ("OPEN-BODY-SIG AppId=" + "\"" + appId + "\"" + ", Timestamp=" + "\"" + timestamp + "\"" + ", Nonce=" + "\"" + nonce + "\"" + ", Signature=" + "\"" + signatureStr + "\"");
+        } else {
+            return ("authorization=OPEN-FORM-PARAM" + "&appId=" + appId + "&timestamp=" + timestamp + "&nonce=" + nonce + "&content=" + URLEncoder.encode(content, "UTF-8") + "&signature=" + URLEncoder.encode(Base64.encodeBase64String(localSignature), "UTF-8"));
+        }
+
+    }
+
+
+    /**
+     * 获取支付链接的Map
+     *
+     * @param amount
+     * @param orderNo
+     * @param notifyUrl
+     * @param returnUrl
+     * @param orderSubject
+     * @return
+     * @throws Exception
+     */
+    public static Map<String, String> getPayMap(BigDecimal amount, String orderNo, String notifyUrl, String returnUrl, String orderSubject) throws Exception {
+        Map<String, String> PayMap = new HashMap<>();
+        JSONObject json = new JSONObject();
+        //H5支付链接生成
+        json.put("totalAmount", amount.multiply(new BigDecimal("100")).intValue());
+        json.put("instMid", "H5DEFAULT");
+        json.put("mid", h5Mid);
+        json.put("tid", h5Tid);
+        json.put("orderDesc", orderSubject);
+        json.put("merOrderId", orderNo);
+        json.put("requestTimestamp", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
+        json.put("expireTime", DateFormatUtils.format(new Date().getTime() + 300000, "yyyy-MM-dd HH:mm:ss"));
+        json.put("notifyUrl", notifyUrl);
+        json.put("returnUrl", returnUrl);
+        String param = getOpenBodySig(H5AppId, h5AppKey, timestamp, nonce, json.toString(), "GET");
+        PayMap.put("aliPay", aliPayUrl + "?" + param);
+        PayMap.put("qmfPay", qmfPayUrl + "?" + param);
+
+        //微信公众号支付链接生成
+        json.put("instMid", "YUEDANDEFAULT");
+        json.put("mid", wpMid);
+        json.put("tid", wpTid);
+
+        param = getOpenBodySig(wpAppId, wpAppKey, timestamp, nonce, json.toString(), "GET");
+        PayMap.put("weChatPay", wpPayUrl + "?" + param);
+        return PayMap;
+    }
+
+    /**
+     * 订单查询
+     *
+     * @param orderNo 自己系统订单号
+     * @return
+     */
+    public static Map query(String orderNo) {
+        JSONObject json = new JSONObject();
+        json.put("instMid", "H5DEFAULT");
+        json.put("mid", h5Mid);
+        json.put("tid", h5Tid);
+        json.put("merOrderId", orderNo);
+        json.put("requestTimestamp", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
+        return new HashMap();
+    }
+
+
+    public static void main(String[] args) throws Exception {
+        String orderNo = "1017" + new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date()) + RandomStringUtils.randomNumeric(7);
+
+        Map<String, String> payMap = getPayMap(new BigDecimal("20.33"), orderNo, "http://pay.dayaedu.com/pay/notify", "http://dev.daya.com", "大雅测试订单");
+        System.out.println("weChat= " + payMap.get("weChatPay"));
+        System.out.println("H5= " + payMap.get("aliPay"));
+    }
+}
+

+ 56 - 21
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/yqpay/YqPayUtil.java

@@ -2,46 +2,81 @@ package com.ym.mec.thirdparty.yqpay;
 
 import com.alibaba.fastjson.JSON;
 
-import java.util.LinkedHashMap;
-import java.util.Map;
+import java.math.BigDecimal;
+import java.util.*;
 
 public class YqPayUtil {
 
-    private String merNo = "0021677";
+    private static final String merNo = "0021677"; //商户号
     private static final String version = "1.1";
-    private String notifyUrl;
-    private String timestamp;
-    private String apiContent;
     private static final String signType = "CFCA";
-    private String sign;
-    private Map<String, Object> resultMap;
-    private Map<String, Object> requestMap;
-
-    public YqPayUtil(String notifyUrl, Map<String, Object> resultMap) throws Exception {
-        Map<String, Object> rqMap = new LinkedHashMap<String, Object>();
-        rqMap.put("merNo", this.merNo);
-        rqMap.put("version", this.version);
+    private static final String payUrl = "https://qyfapi.95epay.com/api/api/hPay/toPayHtml";//支付提交地址
+    private static final String payChannels = "{\"weChatPay\":true,\"weChatPayMobile\":false,\"aliPay\":true,\"fastpayXy\":true,\"aliPayMobile\":false,\"balancePay\":false}";//支付方式配置
+
+    private static Map<String, Object> getRequestMap(String notifyUrl, Map<String, Object> resultMap) throws Exception {
+        Map<String, Object> rqMap = new LinkedHashMap<>();
+        rqMap.put("merNo", merNo);
+        rqMap.put("version", version);
         rqMap.put("notifyUrl", notifyUrl);
         rqMap.put("timestamp", DateUtils.getDateTime());
         rqMap.put("apiContent", JSON.toJSONString(resultMap));
         rqMap.put("signType", signType);
         String beforeSignedData = CFCARAUtil.joinMapValue(rqMap, '&');
-        this.sign = CFCARAUtil.signMessageByP1(beforeSignedData, "config/certificate/yqpay.pfx","aaa123123");
-        rqMap.put("sign", this.sign);
-        this.requestMap = rqMap;
+        String sign = CFCARAUtil.signMessageByP1(beforeSignedData, "config/certificate/yqpay.pfx", "aaa123123");
+        rqMap.put("sign", sign);
+        return rqMap;
     }
 
-    public Map<String, Object> getRequestMap() {
-        return this.requestMap;
+    /**
+     * 获取支付Map
+     *
+     * @param amount
+     * @param orderNo
+     * @param notifyUrl
+     * @param returnUrl
+     * @param orderSubject
+     * @param orderBody
+     * @param routingMerNo
+     * @return
+     * @throws Exception
+     */
+    public static Map<String, Object> getPayMap(BigDecimal amount, String orderNo, String notifyUrl, String returnUrl, String orderSubject, String orderBody, String routingMerNo) throws Exception {
+        List<Map> tempRoutingList = new ArrayList();
+        Map<String, Object> routingList = new HashMap<>();
+        routingList.put("routingMerNo", routingMerNo);//分佣账户
+        routingList.put("routingFee", amount.subtract((amount.multiply(new BigDecimal(0.28)).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_UP))); //分佣金额
+        tempRoutingList.add(routingList);
+
+        Map<String, Object> contentMap = new LinkedHashMap<>();
+        contentMap.put("sellerNo", merNo); //收款商户号
+        contentMap.put("payChannels", payChannels); //支付方式
+        contentMap.put("orderBody", orderBody); //订单信息
+        contentMap.put("payAmount", amount); //支付金额
+        contentMap.put("apiPayType", "1"); //*API支付类型1-即时支付,2-担保支付,3-预授权支付*/
+        contentMap.put("tradeType", "0"); //*交易类型1—充值,0—收款*
+        contentMap.put("merMerOrderNo", orderNo); //商户订单号
+        contentMap.put("orderSubject", orderSubject); //订单标题
+        contentMap.put("returnUrl", returnUrl); //前台页面地址
+        if (routingMerNo != null && !routingMerNo.isEmpty()) {
+            contentMap.put("tempRoutingList", JSON.toJSONString(tempRoutingList));//分账设置
+        }
+        Map<String, Object> payMap = getRequestMap(notifyUrl, contentMap);
+        payMap.put("host", payUrl);
+        return payMap;
     }
 
-    //验签
+    /**
+     * 验签
+     *
+     * @param rsMap
+     * @return
+     */
     public static boolean verify(Map<String, Object> rsMap) {
         String sign = (String) rsMap.get("sign");
         rsMap.remove("sign");
         String beforeSignedData = CFCARAUtil.joinMapValue(rsMap, '&');
         try {
-            return CFCARAUtil.verifyMessageByP1(beforeSignedData, sign, "certificate/sq_formal_sign.cer");
+            return CFCARAUtil.verifyMessageByP1(beforeSignedData, sign, "/config/certificate/sq_formal_sign.cer");
         } catch (Exception e) {
             return false;
         }