iButton with Java Command Processor


The "iButton with Java" (JiB) Command processor allows you to get and set the iButton’s configuration parameters, delete applets, get the current value of the real-time clock, get random data, list the applets that are currently loaded, set the commit buffer size and to master erase the iButton. The Command Processor commands do not use the JavaCard Virtual Machine.

The JiB communicates using Application Protocol Data Units (APDUs) as described in ISO 7816 and the JavaCard 2.0 specification. Command APDUs are sent to the iButton and Response APDUs are received from the iButton. A Status Word (SW) always follows Response APDUs. The SW 0x9000 is returned if the command was executed with no error. The Command APDU header contains the following parameters (All parameters are one-byte except for Data[Lc], which is a byte array of length Lc):

  • CLA: Class

  • INS: Instruction

  • P1: Parameter 1

  • P2: Parameter 2

  • Lc: Length of command data

  • Data[Lc]: Lc bytes of command data

  • Le: Expected response length

  • The following list of JiB commands list the header values and data required for each command. Command categories that are "Master Pin Protected" require a Master PIN in the first bytes of the Data field. The format of the Master PIN is [PIN length byte – Len][Len bytes of PIN data]. The maximum PIN length is eight bytes, therefore every Master PIN protected command will have one to nine bytes of PIN information pre-pended to the data field. A null PIN is represented by a length byte of zero and no PIN data.


    Command Processor Parameters

    CLA: D0h

    INS: 95h

    Administrative commands (Master PIN Protected)

    P1: 00h

    Information commands (Free Access)

    P1: 01h

    Statistical commands (Free Access)

    P1: 02h

    AID commands (Master PIN Protected)

    P1: 03h

    iButton Homepage: http://www.ibutton.com/