using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;

namespace BusinessCommon
{
    public class AuthenticationTicket
    {
        private string mName;
        private DateTime mExpiration;
        private DateTime mIssueDate;
        private string[] mRoles;
        private string mUserData;

        public AuthenticationTicket() { }
        public AuthenticationTicket(string name, DateTime issueDate, DateTime expiration, string[] roles, string userData)
        {
            mName = name;
            mIssueDate = issueDate;
            mExpiration = expiration;
            mRoles = roles;
            mUserData = userData;
        }

        public string Name
        {
            get { return mName; }
        }

        public DateTime IssueDate
        {
            get { return mIssueDate; }
        }

        public DateTime Expiration
        {
            get { return mExpiration; }
        }

        public bool Expired
        {
            get { return mExpiration < DateTime.Now; }
        }

        public string[] Roles
        {
            get { return mRoles; }
        }

        public string UserData
        {
            get { return mUserData; }
        }
    }
}
