public static async Task<SmartCardActivationPolicyChangeResult> SetCardActivationPolicy(SmartCardAppletIdGroupRegistration reg, SmartCardAppletIdGroupActivationPolicy policy)
        {            
            LogMessage("Previous AID group activation policy: " + reg.ActivationPolicy, NotifyType.StatusMessage);

            // Now try to set the policy on the card, this may pop UI to the user asking them to confirm
            var res = await reg.RequestActivationPolicyChangeAsync(policy);
            if (res == SmartCardActivationPolicyChangeResult.Allowed)
            {
                LogMessage("AID group successfully set to " + policy.ToString(), NotifyType.StatusMessage);
            }
            else
            {
                LogMessage("AID group policy change was disallowed (perhaps due to user declining the UI popup)", NotifyType.ErrorMessage);
            }

            return res;
        }
Exemple #2
0
        public static async Task <SmartCardActivationPolicyChangeResult> SetCardActivationPolicy(SmartCardAppletIdGroupRegistration reg, SmartCardAppletIdGroupActivationPolicy policy)
        {
            LogMessage("Previous AID group activation policy: " + reg.ActivationPolicy, NotifyType.StatusMessage);

            // Now try to set the policy on the card, this may pop UI to the user asking them to confirm
            var res = await reg.RequestActivationPolicyChangeAsync(policy);

            if (res == SmartCardActivationPolicyChangeResult.Allowed)
            {
                LogMessage("AID group successfully set to " + policy.ToString(), NotifyType.StatusMessage);
            }
            else
            {
                LogMessage("AID group policy change was disallowed (perhaps due to user declining the UI popup)", NotifyType.ErrorMessage);
            }

            return(res);
        }