Up to higher level directory | |||
Name | Date | Size | |
---|---|---|---|
Android.bp | 05-Oct-2017 | 1.5K | |
ese_relay.c | 05-Oct-2017 | 6K | |
ese_relay_fake.c | 05-Oct-2017 | 900 | |
ese_relay_pn80t_nq_nci.c | 05-Oct-2017 | 1.2K | |
ese_relay_pn80t_spidev.c | 05-Oct-2017 | 1.2K | |
README.md | 05-Oct-2017 | 1.9K |
1 # What? 2 3 ese-relay connects libese's functionality to a local abstract socket on 4 an Android device. The primary purpose is to ease development and provision 5 with test hardware without bringing up all the development tools needed. 6 7 ese-relay uses the same wire protocol as the 8 [Virtual Smart Card](http://frankmorgner.github.io/vsmartcard/) project by acting 9 as the "viccd" service. This enables use of any tool that supports 10 [pcsc-lite](https://pcsclite.alioth.debian.org/) without any additional 11 development. 12 13 # Wire protocol 14 15 The format is always 16 Ln d0..dn 17 Ln is a network byte order 16-bit unsigned integer length of the data. 18 d0..dn are uint8_t bytes to tunneled directly to/from the card. 19 20 If Ln == 1, it indicates an out of band control message. Supported messages 21 are 1:0 - 1:4: 22 * 0: Power off (ignored) 23 * 1: Power on (implemented with a reset) 24 * 3: Reset 25 * 4: ATR - returns a fake ATR 26 27 # Prerequisites 28 29 * pcscd is installed on your system. 30 * Build and install https://frankmorgner.github.io/vsmartcard/virtualsmartcard 31 * Configure /etc/reader.d/vpcd as below. 32 * Build ese-relay configured for the hardware in use. 33 34 ## /etc/reader.conf.d/vpcd: 35 36 FRIENDLYNAME "Virtual PCD" 37 DEVICENAME localhost:0x1000 38 LIBPATH /usr/lib/pcsc/drivers/serial/libifdvpcd.so 39 CHANNELID 0x1000 40 41 This will cause pcscd to connect to localhost port 4096 on start as per the vsmartcard 42 documentation. 43 44 # Usage 45 ## In one terminal, run the service and forward the abstract UNIX socket to a local TCP socket: 46 $ adb shell ese-relay-<hw> 47 $ adb forward tcp:4096 localabstract:ese-relay 48 49 ## In another terminal, restart pcscd configured with an appropriate reader: 50 $ /etc/init.d/pcscd restart # (Or whatever your init system requires.) 51 52 ## In yet another terminal, use your preferred* pcsc client: 53 54 $ java -jar gp.jar -info 55 56 * https://github.com/martinpaljak/GlobalPlatformPro is used here. 57