Package 

Class NfcYubiKeyDevice

  • All Implemented Interfaces:
    com.yubico.yubikit.core.YubiKeyDevice

    
    public class NfcYubiKeyDevice
     implements YubiKeyDevice
                        
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final Tag tag
    • Constructor Summary

      Constructors 
      Constructor Description
      NfcYubiKeyDevice(Tag tag, int timeout, ExecutorService executorService) Instantiates session for nfc tag interaction
    • Method Summary

      Modifier and Type Method Description
      Tag getTag()
      Array<byte> readNdef()
      void remove(Runnable onRemoved) Closes the device and waits for physical removal.
      Transport getTransport()
      boolean supportsConnection(Class<out YubiKeyConnection> connectionType)
      <T extends YubiKeyConnection> T openConnection(Class<T> connectionType)
      <T extends YubiKeyConnection> void requestConnection(Class<T> connectionType, Callback<Result<T, IOException>> callback)
      boolean isYubiKey() Probe the nfc device whether it is a Yubico hardware.
      String toString()
      • Methods inherited from class com.yubico.yubikit.core.YubiKeyDevice

        getTransport, openConnection, requestConnection, supportsConnection
      • Methods inherited from class java.lang.Object

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

      • NfcYubiKeyDevice

        NfcYubiKeyDevice(Tag tag, int timeout, ExecutorService executorService)
        Instantiates session for nfc tag interaction
        Parameters:
        tag - the tag that has been discovered
        timeout - timeout, in milliseconds, to use for NFC communication
    • Method Detail

      • remove

         void remove(Runnable onRemoved)

        Closes the device and waits for physical removal.

        This method signals that we are done with the device and can be used to wait for the user tophysically remove the YubiKey from NFC scan range, to avoid triggering NFC YubiKey detectionmultiple times in quick succession.

      • isYubiKey

         boolean isYubiKey()

        Probe the nfc device whether it is a Yubico hardware.