/// <summary>
        /// This property verifies whether the current machine was prepared for consuming and producing RM protected content. 
        /// If property returns true it could be used as an indication that Init function call will not result in a network transaction.
        /// </summary>
        public static bool IsUserActivated(ContentUser user)
        {
            SecurityHelper.DemandRightsManagementPermission();
        
            if (user == null)
            {
                throw new ArgumentNullException("user");
            }

            // we only let specifically identified users to be used here  
            if ((user.AuthenticationType != AuthenticationType.Windows) && 
                 (user.AuthenticationType != AuthenticationType.Passport))
            {
                throw new ArgumentOutOfRangeException("user", SR.Get(SRID.OnlyPassportOrWindowsAuthenticatedUsersAreAllowed));
            }
            
            using (ClientSession userClientSession = new ClientSession(user))
            {
                // if machine activation is not present we can return false right away             
                return (userClientSession.IsMachineActivated() && userClientSession.IsUserActivated());
            }
        }
        /// <summary>
        /// This function returns a read only collection of the activated users.
        /// </summary>
        static public  ReadOnlyCollection<ContentUser>  GetActivatedUsers()
        {
            SecurityHelper.DemandRightsManagementPermission();
            
            //build user with the default authentication type and a default name 
            // neither name not authentication type is important in this case 
            //ContentUser tempUser = new ContentUser(_defaultUserName, AuthenticationType.Windows);
        
            // Generic client session to enumerate user certificates 
            using(ClientSession genericClientSession = 
                ClientSession.DefaultUserClientSession(AuthenticationType.Windows))
            {
                List<ContentUser> userList = new List<ContentUser>(); 

                // if machine activation is not present we can return empty list right away             
                if (genericClientSession.IsMachineActivated())
                {
                    int index =0; 
                    while(true)
                    {
                        // we get a string which can be parsed to get the ID and type 
                        string userCertificate = genericClientSession.EnumerateLicense(EnumerateLicenseFlags.GroupIdentity, index);

                        if (userCertificate == null)
                            break;

                        // we need to parse the information out of the string 
                        ContentUser user = ClientSession.ExtractUserFromCertificateChain(userCertificate);

                        // User specific client session to check it's status 
                        using(ClientSession userClientSession = new ClientSession(user))
                        {
                            if (userClientSession.IsUserActivated()) 
                            {
                                userList.Add(user);
                            }
                        }

                        index ++;
                    }
                }
                
                return new ReadOnlyCollection<ContentUser>(userList);
            }
        }