Exemple #1
0
        private async void ButtonGetInfo_Click(object sender, RoutedEventArgs e)
        {
            GetFirstUSBDevice();
            StringBuilder message = new StringBuilder();
            var           res     = await con.GetInfoAsync();

            if (res.DeviceStatus == g.FIDO2.CTAP.DeviceStatus.Unauthorized)
            {
                message.Append("Excute Administrator ?");
            }
            else if (res.DeviceStatus == g.FIDO2.CTAP.DeviceStatus.NotConnected)
            {
                message.Append("FIDO Key Not Connected");
            }
            else if (res.DeviceStatus == g.FIDO2.CTAP.DeviceStatus.Ok)
            {
                message.AppendLine($"GetInfoAsync");
                message.AppendLine($"- Status = {res.CTAPResponse.Status}");
                message.AppendLine($"- StatusMsg = {res.CTAPResponse.StatusMsg}");
                message.AppendLine($"-Json response:");
                message.AppendLine(res.CTAPResponse.ResponsePayloadJson);
            }
            else
            {
                message.Append("Error");
            }
            MessageBox.Show(message.ToString());
        }
Exemple #2
0
        private async void ButtonGetInfo_Click(object sender, RoutedEventArgs e)
        {
            var res = await con.GetInfoAsync();

            if (res.DeviceStatus == g.FIDO2.CTAP.DeviceStatus.Unauthorized)
            {
                MessageBox.Show("Excute Administrator ?");
            }
            else if (res.DeviceStatus == g.FIDO2.CTAP.DeviceStatus.NotConnected)
            {
                MessageBox.Show("FIDO Key Not Connected");
            }
            else if (res.DeviceStatus == g.FIDO2.CTAP.DeviceStatus.Ok)
            {
                MessageBox.Show($"GetInfoAsync\r\n- Status = {res.CTAPResponse.Status}\r\n- StatusMsg = {res.CTAPResponse.StatusMsg}");;
            }
            else
            {
                MessageBox.Show("Error");
            }
        }
Exemple #3
0
        private async void ButtonGetInfo_Click(object sender, RoutedEventArgs e)
        {
            addLog("<GetInfo>");
            var res = await con.GetInfoAsync();

            LogResponse(res.DeviceStatus, res.CTAPResponse);
            if (res.DeviceStatus == g.FIDO2.CTAP.DeviceStatus.Unauthorized)
            {
                addLog("Execute Administrator ?");
                return;
            }
            else if (res.DeviceStatus == g.FIDO2.CTAP.DeviceStatus.NotConnected)
            {
                addLog("FIDO Key Not Connected");
                return;
            }
            else if (res.DeviceStatus == g.FIDO2.CTAP.DeviceStatus.Ok)
            {
                if (res.CTAPResponse.Status == 0)
                {
                    addLog("Get CTAP Response");
                }
            }
        }