Esempio n. 1
0
        private static string BuildRequestMysign(Dictionary <string, string> sPara)
        {
            string str;
            string str1      = Hidistro.ControlPanel.OutPay.App.Core.CreateLinkString(sPara);
            string mD5       = "";
            string _signType = Hidistro.ControlPanel.OutPay.App.Core._sign_type;

            if (_signType != null)
            {
                if (_signType == "RSA")
                {
                    mD5 = RSAFromPkcs8.sign(str1, Hidistro.ControlPanel.OutPay.App.Core._private_key, Hidistro.ControlPanel.OutPay.App.Core._input_charset);
                    str = mD5;
                    return(str);
                }
                else
                {
                    if (_signType != "MD5")
                    {
                        mD5 = "";
                        str = mD5;
                        return(str);
                    }
                    mD5 = Hidistro.ControlPanel.OutPay.App.Core.GetMD5(string.Concat(str1, Hidistro.ControlPanel.OutPay.App.Core._private_key), Hidistro.ControlPanel.OutPay.App.Core._input_charset);
                    str = mD5;
                    return(str);
                }
            }
            mD5 = "";
            str = mD5;
            return(str);
        }
Esempio n. 2
0
        private static string BuildRequestMysign(Dictionary <string, string> sPara)
        {
            string content = CreateLinkString(sPara);

            switch (_sign_type)
            {
            case "RSA":
                return(RSAFromPkcs8.sign(content, _private_key, _input_charset));

            case "MD5":
                return(GetMD5(content + _private_key, _input_charset));
            }
            return("");
        }
Esempio n. 3
0
        private static string BuildRequestMysign(Dictionary <string, string> sPara)
        {
            string text      = Core.CreateLinkString(sPara);
            string sign_type = Core._sign_type;
            string result;

            if (sign_type != null)
            {
                if (sign_type == "RSA")
                {
                    result = RSAFromPkcs8.sign(text, Core._private_key, Core._input_charset);
                    return(result);
                }
                if (sign_type == "MD5")
                {
                    result = Core.GetMD5(text + Core._private_key, Core._input_charset);
                    return(result);
                }
            }
            result = "";
            return(result);
        }