--On Tuesday, April 18, 2006 20:28:58 +0000 Sergio C <[EMAIL PROTECTED]>
wrote:
As I can see, the usb subsystem sends additional data to the eToken PRO
attached as follow: there are some bytes before the APDU's Header (00 40
05) and after the body (C9)... Has anyone idea about what this bytes
represent and how they can be calculated?
This is the T=1 TPDU (Transport Protocol Data Unit) wrapping.
T=1 is defined in a 1992 annex to ISO-7816-3 (I cannot find a free online
copy)
The additional prefix bytes are NAD (node address), PCB (procedure byte),
and LEN (length)
The trailing byte is an LRC (longitudal checksum), which is the XOR of all
the preceeding bytes, such that the xor of the entire TPDU is 0. Some cards
apparently require the use of a 2 byte CRC instead, but I have not
encountered any such.
NAD describes the source and destination of the message, but in most cases
you don't need it and it is 0.
PCB describes what kind of TPDU this is, but the encoding is complex. For
an ordinary data TPDU (I-Block), the PCB alternates between 0x0 and 0x40
LEN is the length of the data being transported, not including the header
or checksum (which is referred to as the information field)
_______________________________________________
opensc-devel mailing list
[email protected]
http://www.opensc-project.org/mailman/listinfo/opensc-devel