Skip to content
Martin Paljak edited this page Apr 20, 2019 · 11 revisions

BIBO

Bytes In, Bytes Out

Interface that allows to send a bag of bytes and receive a bag of bytes (or an exception) as a reply. Command-response.

byte[] transceive(byte[] bytes) throws IOException;

Implementations could be a UNIX pipe, a UDP message, JSON over HTTP, PC/SC API or anything similar.

APDUBIBO

APDU is an ancient convention of formatting bags of bytes. Keywords like CLA, INS, P1, P2, LC, LE, SW etc. CommandAPDU and ResponseAPDU provide convenience methods for constructing and parsing those byte arrays. Some ancient formatting, but still a bag of bytes.

ResponseAPDU transmit(CommandAPDU apdu) throws IOException;

Sessions and channels

A session is a series of APDU transmits. A technical session can be considered broken if IOException is thrown. A logical session is responsibility of the application (interpretation of APDU-s)

A channel is a logical multiplexing on top of the physical BIBO (like a logical session is based on APDU-s). SE access is still serialized to a single command-response channel.

BIBO providers

  • PC/SC (provided by apdu4j with the help of jnasmartcardio)
  • Android NFC
  • OpenMobileAPI
  • RemoteEMV (provided by apdu4j)
  • Raspi i2c
  • ...

PC/SC, Terminals and javax.smartcardio

PC/SC is the ages-old desktop oriented C API to enumerate smart card readers and talk to cards in those readers. Not required to have a BIBO to a secure element (can use direct USB CCID like GnuPG or some other USB framing than CCID). But it is the default protocol stacking layer present in desktop environments. javax.smartcardio is the Java-adaption of the PC/SC API. jnasmartcardio is the JNA re-implementation of the PC/SC API in Java, in javax.smartcardio-compatible way.

Modern environments like Android NFC have no notion of PC/SC (but the "reader" concept carries on to API-s like OpenMobileAPI) https://developer.android.com/reference/android/se/omapi/package-summary.html

apdu4j-core will be renamed to apdu4j. Current apdu4j will be renamed to apdu4j-pcsc. apdu4j-android will be created.

Other software

  • OCF - OpenCard Framework
  • scuba
Clone this wiki locally