Exemplo n.º 1
0
        static public AuthenticationInfo Decode(string authenticationCookie)
        {
            byte[] data = Convert.FromBase64String(authenticationCookie);
            RC4.Transform(data);

            using (var stream = new MemoryStream(data))
            {
                var ai = new AuthenticationInfo();
                ai.ReadFromStream(stream);
                return(ai);
            }
        }
Exemplo n.º 2
0
        static public string Encode(AuthenticationInfo ai)
        {
            using (var stream = new MemoryStream())
            {
                ai.WriteToStream(stream);
                var data = stream.ToArray();

                RC4.Transform(data);

                string sEncoded = Convert.ToBase64String(data);
                return(sEncoded);
            }
        }