Ejemplo n.º 1
0
 protected string GetQueryString()
 {
     this.PrepareQueryArgs(_getArgs);
     if (null == _getArgs)
     {
         return(string.Empty);
     }
     return(WebUtil.BuildEscapeDataString(_getArgs.GetCollection()));
 }
Ejemplo n.º 2
0
 protected string GetFormString()
 {
     this.PrepareFormArgs(_postArgs);
     if (null == _postArgs)
     {
         return(string.Empty);
     }
     return(WebUtil.BuildEscapeDataString(_postArgs.GetCollection()));
 }
Ejemplo n.º 3
0
        bool CheckSignature(WyxSessionInfo data, string secret)
        {
            if (string.IsNullOrEmpty(data.Signature))
            {
                return(false);
            }
            var    signDic = data.ToCollection(true, WyxSessionInfo.SIGNKeys);
            string baseStr = WebUtil.BuildEscapeDataString(signDic);

            signDic.Clear();
            return(string.Compare(data.Signature, CryptoUtil.GetSHA1(baseStr + secret, "x2"), true) == 0);
        }
Ejemplo n.º 4
0
        protected override void PrepareArgs(IWebArgs args)
        {
            var wyxArgs = args as WyxWebArgs;

            if (null == wyxArgs)
            {
                return;
            }
            wyxArgs.AppKey    = WyxCache.AppCfg.AppKey;
            wyxArgs.Timestamp = WeiboUtil.GetTimeStamp().ToString();
            if (!this.NoSesssionKey && !string.IsNullOrEmpty(_session.SessionKey))
            {
                wyxArgs.SessionKey = _session.SessionKey;
            }
            var signKeys = wyxArgs.GetCollection().AllKeys;

            Array.Sort(signKeys);
            var    signDic = wyxArgs.ToCollection(true, signKeys);
            string baseStr = WebUtil.BuildEscapeDataString(signDic);

            signDic.Clear();
            wyxArgs.Signature = CryptoUtil.GetSHA1(baseStr + WyxCache.AppCfg.AppSecret, "x2");
        }