Beispiel #1
0
 /// <summary>
 /// 签名数据
 /// </summary>
 /// <param name="merId">供应商ID</param>
 /// <param name="plain">原始文本</param>
 /// <returns></returns>
 private string SignData(string rawText)
 {
     //byte[] StrRes = Encoding.GetEncoding("utf-8").GetBytes(rawText);
     //rawText = Convert.ToBase64String(StrRes);
     // 对一段字符串的签名
     return(netPay.Sign(rawText));
 }
Beispiel #2
0
        //签名
        public static string signData(string merId, string plain, string priKeyPath)
        {
            byte[] StrRes = Encoding.GetEncoding("gbk").GetBytes(plain);
            plain = Convert.ToBase64String(StrRes);

            NetPay a = new NetPay();

            //设置密钥文件地址
            a.buildKey(merId, 0, priKeyPath);

            // 对一段字符串的签名
            return(a.Sign(plain));
        }
Beispiel #3
0
    //签名
    public static string sign(string MerId, string plain)
    {
        NetPay  netPay = new NetPay();
        Boolean flag   = netPay.buildKey(MerId, 0, SignData.priKeyPath);
        string  sign   = null;

        if (flag)
        {
            if (netPay.PrivateKeyFlag)
            {
                sign = netPay.Sign(plain);
            }
        }
        return(sign);
    }
        //签名
        public static string sign(string MerId, string plain)
        {
            NetPay netPay = new NetPay();
            Boolean flag = netPay.buildKey(MerId, 0, NetConfig.priKeyPath);
            string sign = null;
            if (flag)
            {
                if (netPay.PrivateKeyFlag)
                {
                    sign = netPay.Sign(plain);
                }
            }
            return sign;

        }