Beispiel #1
0
        /// <summary>
        /// 解析用户凭证
        /// </summary>
        /// <param name="token">用户凭证</param>
        /// <param name="aes_key">商户公钥</param>
        public UserToken(string token)
        {
            if (string.IsNullOrEmpty(token))
            {
                State = false; return;
            }
            string tokenJson = DESEncrypt.DecryptDecoding(token, aes_key);
            var    obj       = JsonHelper.Deserialize <UserToken>(tokenJson);

            if (obj != null)
            {
                this.MenKey    = obj.MenKey;
                this.UId       = obj.UId;
                this.TimeStamp = obj.TimeStamp;
                this.UserHash  = obj.UserHash;
                State          = true;
            }
            else
            {
                State = false;
            }
        }
Beispiel #2
0
 /// <summary>
 /// 解密
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 public string DesDecrypt(string data)
 {
     return(DESEncrypt.DecryptDecoding(data));
 }