Ejemplo n.º 1
0
        private void SetMac(string Signtype)
        {
            string[] src = new string[rc.Keys.Length];
            for (int i = 0; i < rc.Keys.Length; i++)
            {
                src[i] = rc[i].Trim();
            }
            var    srcordered = src.OrderBy(s => s);
            string mac        = "";

            if (Signtype == "MD5")
            {
                mac = string.Join("", srcordered) + INITools.GetIniKeyValue("MobileCZ", "MD5_key").Trim();
                rc.Set("mac", DESHelper.ComputeMD5Hash(mac));
            }
            else
            {
                mac = string.Join("", srcordered);
                rc.Set("mac", RSAHelper.SignWithSHA1(INITools.GetIniKeyValue("MobileCZ", "RSA_private_key").Trim(), mac));
            }
        }