Exemplo n.º 1
0
        public static AuthToken Decrypt(string data)
        {
            try
            {
                if (data == null)
                {
                    return(null);
                }

                data = WebUtility.UrlDecode(data);
                var    wrapper   = JsonConvert.DeserializeObject <TokenWrapper>(data, new IsoDateTimeConverter());
                string tokenJson = CryptoUtility.DecryptDES(wrapper.Token);
                return(JsonConvert.DeserializeObject <AuthToken>(tokenJson, new IsoDateTimeConverter()));
            }
            catch
            {
                return(null);
            }
        }