问题
I am new to world of ISO 7816 smart-card programming, I have good knowledge about contactless programming, I have SCOSTA card and I tried my best to read/write data on it but always it response to me with Error 6986.
回答1:
You first need to select a file or indicate a file within the READ BINARY command before you can read data from these kind of cards. You currently get an exception that means that you haven't selected a file yet. Memory cards commonly have a single interface and a default selected file so you can directly send read commands. But a file based Smart Card implementation such as SCOSTA requires you to first select the file and - most likely - a DF (directory) first.
Now an application directory is a special DF that can also be selected by name. For instance, passport applications have an AID that is A0000002471001
where A000000247
is the RID (for application providers) of ICAO. So on passports you should be able to select this directory. Then you need to select a file as well, e.g. EF.SOD which you can select by putting the short file identifier 1D
in the READ BINARY command.
Which files are present depends on the application / personalization. In general there is no universally established way of defining what is on a card - a smart card is just like a general purpose computer in that sense. So you need to find the specifications of the protocol you want to use first.
Cards that have not yet been personalized may well have no files defined yet.
来源:https://stackoverflow.com/questions/44565238/how-to-work-with-scosta-smart-card-create-mf-df-ef-and-write-read-data-et