ZeroPass / dmrtd

Dart library for reading Biometric Passport
Other
43 stars 19 forks source link

Apdu with usb #1

Closed redDwarf03 closed 2 years ago

redDwarf03 commented 2 years ago

Hello I would like to send an APDU to a device with usb connection and not with nfc. Is it possible with your lib ? Thx

smlu commented 2 years ago

Hey, sending APDU commands to USB communication interface is not supported (yet). For that you would have to implement ComProvider to communicate with USB device.

After such interface is implemented it'd be easy to use it with e.g. ISO7816 class ICC (if not reading biometric passports). For example:

var usbCom = UsbComProvider(...);
var icc = ICC(usbCom);
icc.selectFileByPath(...);
icc.readBinary(offset: 0, ne: ...);

Note, that the _transceive method of class ICC is private but I could make it public if you need to send raw APDU commands.

redDwarf03 commented 2 years ago

Thx. I will try this and I will send you a feedback! That is for send commands to ledger key (https://www.ledger.com/)

smlu commented 2 years ago

@redDwarf03 fyi, the flutter NFC kit library is adding support for WebUSB.