/// <summary> /// 转换为签名字符串 /// </summary> /// <param name="value"></param> /// <param name="appInfo"></param> /// <returns></returns> public static string ToSignString(this string value, SysAuthorizeInfo appInfo) { if (appInfo != null) { return(appInfo.ToSignData(value)); } return(value); }
public void TestMethod1() { string key = Guid.NewGuid().ToString().Replace("-",string.Empty); SysAuthorizeInfo appInfo = new SysAuthorizeInfo(); appInfo.FromSignData("timespan=1434372013;appsource=1;appclient=1;token=SeBCjJYRkujxEsgv9XupyHY7aMkdQuQcqGMu0wQMbhw=;appversion=1.0;"); var newSignData = appInfo.ToSignData(key); appInfo.FromSignData(newSignData); var result = appInfo.CheckSign(key); }
public static void SysAuth() { string key = Guid.NewGuid().ToString().Replace("-", string.Empty); SysAuthorizeInfo appInfo = new SysAuthorizeInfo(); appInfo.FromSignData("timespan=1434372013;appsource=1;appclient=1;token=SeBCjJYRkujxEsgv9XupyHY7aMkdQuQcqGMu0wQMbhw=;appversion=1.0;"); var newSignData = appInfo.ToSignData(key); appInfo.FromSignData(newSignData); var result = appInfo.CheckSign(key); }
public void TikectTest() { var info = new SysAuthorizeInfo(); info.AppSource = "FrontWeb"; info.AppClient = "PC"; info.AppVersion = "1.0"; info.DeviceId = "Test Device"; info.WebBrowser = "Chrome"; var ticket = info.ToSignData("5c567449b8714a038c464059788d4fa6"); // appclient=PC;appsource=FrontWeb;appversion=1.0;deviceid=Test%20Device;timespan=1495277505;webbrowser=Chrome;sign=tBL1yvayljCTiBvO7u3As%2F3RLoc%3D }