简体   繁体   中英

How does memory on a smart card work and how to acces the digital tachograph card's unique ID

For my first internship I have to do some awesome stuff with European tachograph readers.

In short: I have to use a smart card reader to read a contacted (not a radio smartcard) ISO 7816 company card to read out the unique identifier of that card. Nothing else. I then have to sent that Identifier together with the answer-to-reset to somewhere else, where it is processed, answered, and then some data talk up and down.

No code is there, I have to build everything including the server somewhere in the future. For now, I focus on the card part. I started from scratch and was asked to use C# for this. I use the PCSC-lite library on Linux and can already communicate with the card. I am able to get the answer-to-reset codes and was able to do some other stuff with the smartcard which is not important for my question. I also read most of the ISO 7816 datasheets. Especially the parts that seemed important to me. My code reads back the responses and checks what sw1 and sw2 is. So I can read debug info. So I would like to think that I've at least got some basics covered...

I'm the only one in the company who can do this stuff.. Or should be able to do this. And I'm down on my last breath.

Could somebody, who has any experience in the field. Please explain in simple terms to me:

1. How the memory on such a card is build up

2. How to acces the memory

3. Which APDUs and in which order to send them to get the unique card identifier (or point me in the direction to where I can find a memory map or something)

For question one I specifically mean: I know the data structure seems to work with EF's which i need to "select" and than try to extract data using the correct apdu's. But I don't really understand how it works or how the memory structure is build. I've read the ISO files, but they are a bit difficult for me. Maybe if I get some help, I understand them better.

For question two I specifically mean: Under normal circumstances, what Apdu's and in what order should I send them, to access a piece of memory.

I already read a lot on stack overflow on the subject but couldn't find an answer that worked for me.

I will be forever in your debt and you've helped a student if you are so kind to answer my question:)

  • Oscar

I'm not sure, whether I understand your question (and I work with smart cards for many years). There is no free-floating available memory on a file-system based smart card (as opposed to dumb memory cards like SLE44), you can only access it via files (EFs in that case). While one can in principle create new files, real life cards require specific authentications for that and you are unlikely to have the keys for those.

Which files already exist (and which data is stored in which record/offset/data object) is given in the specification, in your case in one of the specifications to found here . The used specification is essential, because the card itself could support many applications, and tachograph is just one of them. As soon as you know, where the data is, you have to create the corresponding SELECT / READ RECORD / READ BINARY commands.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM