Ejemplo n.º 1
0
        private async Task OnValidateData(ISmartCard smartCard)
        {
            try
            {
                // try to get the data
                var data = await smartCard.GetData();

                // if we get here, we got the data
                AppendText("Retrieved data from card:");
                AppendText(data);

                // Todo: Add validation of data
                var date = DateTime.Parse(data);
                if (DateTime.Now > date)
                {
                    await SetResult(false);
                }
                else
                {
                    await SetResult(true);
                }
            }
            catch (SmartCardException)
            {
                AppendText("Error, card not read");
            }
        }
Ejemplo n.º 2
0
        private async Task OnValidatePin(ISmartCard smartCard)
        {
            try
            {
                // try to get the data
                var data = await smartCard.GetData();

                // if we get here, we got the data
                AppendText("Successfully validated pin");
                AppendText(data);
            }
            catch (SmartCardException)
            {
                AppendText("Incorrect PIN");
            }
        }
Ejemplo n.º 3
0
        private async Task OnValidateData(ISmartCard smartCard)
        {
            try
            {
                // try to get the data
                var data = await smartCard.GetData();
                // if we get here, we got the data
                AppendText("Retrieved data from card:");
                AppendText(data);

                // Todo: Add validation of data
                var date = DateTime.Parse(data);
                if(DateTime.Now > date)
                    await SetResult(false);
                else 
                    await SetResult(true);
            }
            catch (SmartCardException)
            {
                AppendText("Error, card not read");
            }
        }
 private async Task OnValidatePin(ISmartCard smartCard)
 {
     try
     {
         // try to get the data
         var data = await smartCard.GetData();
         // if we get here, we got the data
         AppendText("Successfully validated pin");
         AppendText(data);
     }
     catch (SmartCardException)
     {
         AppendText("Incorrect PIN");
     }
 }