Userland USB Gadget implementation of CCID/ICCD class.
Project description
Userland USB Gadget implementation of CCID/ICCD class.
Implements an N-slots USB virtual IC card reader.
Usage
In a nutshell:
import f_ccid
with f_ccid.ICCDFunction(path, slot_count=1) as ccid:
ccid.slot_list[0].insert(card)
ccid.processEventsForever()
(but check out functionfs.gadget to setup configfs for you, and provide the path argument above)
This module does not provide any card implementation.
The expected card API is:
card.clearVolatiles() -> None
Called when virtual power is cut to the card, which means it must flush its volatile state.
card.getATR() -> bytearray
Called when the host tells the reader to power the card. This must return the Answer To Reset bytestring for this card. Note that the answer must be mutable: although it will not be altered by the reader, it will be passed on to C code which technically could mutate it.
card.runAPDU(: bytearray) -> bytearray
Called when the host requests an Application Protocol Data Unit to be executed by the card. The returned value must contain any response, followed by any status bytes. Only entire APDUs are sent to the card (assembly is done by the reader).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file usb-f-ccid-0.1.tar.gz
.
File metadata
- Download URL: usb-f-ccid-0.1.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.4.2 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.8.0 tqdm/4.51.0 CPython/3.9.1rc1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e14f6c28d070ac4ba2c2b4007f0de1cc4947e1eac476ad54aefd1dc4655f075 |
|
MD5 | 10911d6196b2f801664dbfb85a2731d8 |
|
BLAKE2b-256 | ca62b2cc625327aac7077427ecce9752062cb5c891da281b18005ba14f911f19 |