Class UsbOtpConnection

java.lang.Object
com.yubico.yubikit.android.transport.usb.connection.UsbOtpConnection
All Implemented Interfaces:
com.yubico.yubikit.core.otp.OtpConnection, com.yubico.yubikit.core.YubiKeyConnection, Closeable, AutoCloseable

public class UsbOtpConnection extends Object implements com.yubico.yubikit.core.otp.OtpConnection
Class that provides interface to read and send data over YubiKey HID (keyboard) interface

NOTE: when we release HID interface YubiKey will be recognized as keyboard again, it may give you a flash of UI on Android (notification how to handle Keyboard) which means your active Activity may got to background for a moment be aware of that and make sure that your app can handle that.

  • Method Details

    • receive

      public void receive(byte[] report) throws IOException
      Specified by:
      receive in interface com.yubico.yubikit.core.otp.OtpConnection
      Throws:
      IOException
    • send

      public void send(byte[] report) throws IOException
      Write single feature report
      Specified by:
      send in interface com.yubico.yubikit.core.otp.OtpConnection
      Parameters:
      report - blob size of FEATURE_RPT_SIZE
      Throws:
      IOException
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • isClosed

      public boolean isClosed()