Class NfcYubiKeyDevice

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

    
    public class NfcYubiKeyDevice
     implements YubiKeyDevice
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final Tag tag
      public final static int YUBICO_VENDOR_ID
    • Constructor Summary

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

      Enum Constants 
      Enum Constant Description
    • 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

      • getTag

         Tag getTag()
        Returns:

        NFC tag that has been discovered

      • 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 to physically remove the YubiKey from NFC scan range, to avoid triggering NFC YubiKey detection multiple times in quick succession.

      • isYubiKey

         boolean isYubiKey()

        Probe the nfc device whether it is a Yubico hardware.

        Returns:

        true if this device is a YubiKey or a Security Key by Yubico.