Class UsbOtpConnection

  • All Implemented Interfaces:
    com.yubico.yubikit.core.otp.OtpConnection, com.yubico.yubikit.core.YubiKeyConnection, java.io.Closeable, java.lang.AutoCloseable

    public class UsbOtpConnection
    extends java.lang.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.

    • Field Summary

      • Fields inherited from interface com.yubico.yubikit.core.otp.OtpConnection

        FEATURE_REPORT_SIZE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      boolean isClosed()  
      void receive​(byte[] report)  
      void send​(byte[] report)
      Write single feature report
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • receive

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

        public void send​(byte[] report)
                  throws java.io.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:
        java.io.IOException
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
      • isClosed

        public boolean isClosed()