コード例 #1
0
        private async void OnFindDevice(object sender, g.FIDO2.CTAP.BLE.BLEAuthenticatorScanner.FindDeviceEventArgs e)
        {
            scannerBLE.Stop();
            addressBLE = e.BluetoothAddress;

            var ret = await this.connectBLE();

            if (ret == false)
            {
                return;
            }

            // UIスレッドで実行するおまじない
            var ignored = this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (Action)(async() => {
                var app = (MainWindow)Application.Current.MainWindow;
                var ass = await app.Authenticate(conBLE, app.RPID, app.Challenge, app.CredentialID, null);
                if (ass == null)
                {
                    return;
                }

                if (page == null)
                {
                    page = new Page31(ass);
                }
                this.NavigationService.Navigate(page);
            }));
        }
コード例 #2
0
        private async void GetAssertion_Click(object sender, RoutedEventArgs e)
        {
            var app = (MainWindow)Application.Current.MainWindow;
            var ass = await app.Authenticate(new HIDAuthenticatorConnector(), app.RPID, app.Challenge, app.CredentialID, this.TextPIN.Text);

            if (ass == null)
            {
                return;
            }

            if (page == null)
            {
                page = new Page31(ass);
            }
            this.NavigationService.Navigate(page);
        }