예제 #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))));
 }