Exemplo n.º 1
0
        public string sign(string key, string inputCharset)
        {
            StringBuilder stringBuilder = new StringBuilder();

            this.keyValues.Sort(new KeyValues.KeyValueComparer());
            foreach (KeyValue current in this.keyValues)
            {
                URLUtils.appendParam(stringBuilder, current.getKey(), current.getVal());
            }
            URLUtils.appendParam(stringBuilder, AppConstants.KEY, key);
            string text = stringBuilder.ToString();

            text = text.Substring(1, text.Length - 1);
            return(MD5Encoder.encode(text, inputCharset));
        }
Exemplo n.º 2
0
 public static void appendParam(StringBuilder sb, string name, string val, bool and, string charset)
 {
     if (and)
     {
         sb.Append("&");
     }
     else
     {
         sb.Append("?");
     }
     sb.Append(name);
     sb.Append("=");
     if (val == null)
     {
         val = "";
     }
     if (string.IsNullOrEmpty(charset))
     {
         sb.Append(val);
         return;
     }
     sb.Append(URLUtils.encode(val, charset));
 }
Exemplo n.º 3
0
 public static void appendParam(StringBuilder sb, string name, string val, bool and)
 {
     URLUtils.appendParam(sb, name, val, and, null);
 }
Exemplo n.º 4
0
 public static void appendParam(StringBuilder sb, string name, string val, string charset)
 {
     URLUtils.appendParam(sb, name, val, true, charset);
 }