On Friday 24 March 2006 03:10, Gavin Hamill wrote:
> Any advice from EMV-savvy people warmly welcomed! :)
Although I haven't worked with EMV in particular, I might be able to help.
Much data on smart cards is encoded in TLV (Tag Length Value) format. The
data you read from your card is in this format. So after you get the data
out with the READ RECORD (or READ DATA) command, you need to parse it to find
the tag you're interested in, then retrieve the value.
TLV is a generic concept, the specific definition used in most applications is
the ASN.1 BER (Basic Encoding Rules). You can find a full definition at:
http://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf
The EMV 4.1 spec includes a summary in the annexes of book 3, also.
So the first byte you get from READ is the first byte of a tag. In the
examples you gave, you got 'p', which is 0x70, a single-byte tag (multi-byte
tags have the lower five bits of the first byte set). The next byte is
therefore the first (and perhaps only) byte of the length field. And so on.
The encoding of a tag (bit 6 set) may also indicate that the value is
"constructed", meaning it is also a TLV structure which you'll need to parse.
Hope that helps,
Shawn.
_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle