protected string GetQueryString() { this.PrepareQueryArgs(_getArgs); if (null == _getArgs) { return(string.Empty); } return(WebUtil.BuildEscapeDataString(_getArgs.GetCollection())); }
protected string GetFormString() { this.PrepareFormArgs(_postArgs); if (null == _postArgs) { return(string.Empty); } return(WebUtil.BuildEscapeDataString(_postArgs.GetCollection())); }
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); }
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"); }