Пример #1
0
        public static string Encrypt(string userId)
        {
            var data = new UserIdSessionData
            {
                UserId    = userId,
                IssueDate = DateTime.Now
            };

            return(Encrypt(data));
        }
Пример #2
0
        public static UserIdSessionData Decrypt(string input)
        {
            var str = String.Empty;
            UserIdSessionData data = null;

            try
            {
                str = AESDecrypt(UrlDecode(input));
            }
            catch (Exception)
            { }

            if (!String.IsNullOrEmpty(str))
            {
                data = Utils.DeserializeDataContract <UserIdSessionData>(str);
            }

            return(data);
        }
Пример #3
0
 public static string Encrypt(UserIdSessionData data)
 {
     return(UrlEncode(AESEncrypt(Utils.DataContractToJson(data))));
 }