Esempio n. 1
0
        public static async Task <FidoHidDevice> OpenAsync(HidDevice hidDevice)
        {
            var device = new FidoHidDevice(hidDevice);

            try { await device.InitAsync().ConfigureAwait(false); }
            catch (FidoException fe) when(fe.Type == FidoError.TokenBusy ||
                                          fe.Type == FidoError.InterruptedIO ||
                                          fe.Type == FidoError.Timeout)
            {
                return(null);
            }
            return(device);
        }
Esempio n. 2
0
 /// <summary>
 /// Waits until at least one FIDO token is present, returns one of the available
 /// </summary>
 public static async Task <FidoUsbToken> WaitForFirstToken(CancellationToken cancellationToken)
 => new FidoUsbToken(await FidoHidDevice.WaitForFidoHidDevice(cancellationToken).ConfigureAwait(false));
Esempio n. 3
0
 /// <summary>
 /// Waits until at least one FIDO token is present, returns a list of all available tokens
 /// </summary>
 public static async Task <IList <FidoUsbToken> > WaitForTokens(CancellationToken cancellationToken)
 => (await FidoHidDevice.WaitForFidoHidDevices(cancellationToken).ConfigureAwait(false))
 .Select(h => new FidoUsbToken(h))
 .ToList();
Esempio n. 4
0
 private FidoUsbToken(FidoHidDevice fidoHidTransport) : base(fidoHidTransport)
 {
 }