Class NfcYubiKeyDevice
java.lang.Object
com.yubico.yubikit.android.transport.nfc.NfcYubiKeyDevice
- All Implemented Interfaces:
com.yubico.yubikit.core.YubiKeyDevice
-
Constructor Summary
ConstructorsConstructorDescriptionNfcYubiKeyDevice
(android.nfc.Tag tag, int timeout, ExecutorService executorService) Instantiates session for nfc tag interaction -
Method Summary
Modifier and TypeMethodDescriptionandroid.nfc.Tag
getTag()
com.yubico.yubikit.core.Transport
boolean
Probe the nfc device whether it is a Yubico hardware.<T extends com.yubico.yubikit.core.YubiKeyConnection>
TopenConnection
(Class<T> connectionType) byte[]
readNdef()
void
Closes the device and waits for physical removal.<T extends com.yubico.yubikit.core.YubiKeyConnection>
voidrequestConnection
(Class<T> connectionType, com.yubico.yubikit.core.util.Callback<com.yubico.yubikit.core.util.Result<T, IOException>> callback) boolean
supportsConnection
(Class<? extends com.yubico.yubikit.core.YubiKeyConnection> connectionType) toString()
-
Constructor Details
-
NfcYubiKeyDevice
Instantiates session for nfc tag interaction- Parameters:
tag
- the tag that has been discoveredtimeout
- timeout, in milliseconds, to use for NFC communication
-
-
Method Details
-
getTag
public android.nfc.Tag getTag()- Returns:
- NFC tag that has been discovered
-
readNdef
- Throws:
IOException
-
remove
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.
-
getTransport
public com.yubico.yubikit.core.Transport getTransport()- Specified by:
getTransport
in interfacecom.yubico.yubikit.core.YubiKeyDevice
-
supportsConnection
public boolean supportsConnection(Class<? extends com.yubico.yubikit.core.YubiKeyConnection> connectionType) - Specified by:
supportsConnection
in interfacecom.yubico.yubikit.core.YubiKeyDevice
-
openConnection
public <T extends com.yubico.yubikit.core.YubiKeyConnection> T openConnection(Class<T> connectionType) throws IOException - Specified by:
openConnection
in interfacecom.yubico.yubikit.core.YubiKeyDevice
- Throws:
IOException
-
requestConnection
public <T extends com.yubico.yubikit.core.YubiKeyConnection> void requestConnection(Class<T> connectionType, com.yubico.yubikit.core.util.Callback<com.yubico.yubikit.core.util.Result<T, IOException>> callback) - Specified by:
requestConnection
in interfacecom.yubico.yubikit.core.YubiKeyDevice
-
isYubiKey
public 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.
-
toString
-