-
- All Implemented Interfaces:
-
com.yubico.yubikit.core.YubiKeyDevice,java.io.Closeable,java.lang.AutoCloseable
public class UsbYubiKeyDevice implements YubiKeyDevice, Closeable
-
-
Constructor Summary
Constructors Constructor Description UsbYubiKeyDevice(UsbManager usbManager, UsbDevice usbDevice)Creates the instance of usb session to interact with the yubikey device.
-
Method Summary
Modifier and Type Method Description UsbDevicegetUsbDevice()Returns yubikey device attached to the android device with the android device acting as the USBhost. voidsetOnClosed(Runnable onClosed)booleanhasPermission()UsbPidgetPid()TransportgetTransport()booleansupportsConnection(Class<out YubiKeyConnection> connectionType)<T extends YubiKeyConnection> voidrequestConnection(Class<T> connectionType, Callback<Result<T, IOException>> callback)<T extends YubiKeyConnection> TopenConnection(Class<T> connectionType)voidclose()StringtoString()-
Methods inherited from class com.yubico.yubikit.core.YubiKeyDevice
getTransport, openConnection, requestConnection, supportsConnection -
Methods inherited from class java.io.Closeable
close -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
UsbYubiKeyDevice
UsbYubiKeyDevice(UsbManager usbManager, UsbDevice usbDevice)
Creates the instance of usb session to interact with the yubikey device.- Parameters:
usbManager- UsbManager for accessing USB devicesusbDevice- device connected over usb that has permissions to interact with
-
-
Method Detail
-
getUsbDevice
UsbDevice getUsbDevice()
Returns yubikey device attached to the android device with the android device acting as the USBhost. It describes the capabilities of the USB device and allows to get properties/name/productid/manufacturer of device
-
setOnClosed
void setOnClosed(Runnable onClosed)
-
hasPermission
boolean hasPermission()
-
getPid
UsbPid getPid()
-
getTransport
Transport getTransport()
-
supportsConnection
boolean supportsConnection(Class<out YubiKeyConnection> connectionType)
-
requestConnection
<T extends YubiKeyConnection> void requestConnection(Class<T> connectionType, Callback<Result<T, IOException>> callback)
-
openConnection
<T extends YubiKeyConnection> T openConnection(Class<T> connectionType)
-
close
void close()
-
-
-
-