Hello, welcome to SHENZHEN RZX TECHNOLOGY CO.,LTD

Technology Exchange

Technology Exchange
  • Service line

    0755-29824687
  • Service line

    0755-29824683
  • Service line

    0755-29824684
  • Service line

    0755-29492766
  • Service line

    0755-29491366
  • Customer

    0755-29824689

Technology Exchange

Current position:Home > Technology Exchange > Technology Exchange

What matters should be paid attention to in application software programming for non-CPU cards and CPU cards?

Time:2021-01-05 11:39:40


In the process of issuing smart cards, the data structure and data transfer of the card are also very important. In the programming of the IC card application software on the PC side, there is a big difference between the non-CPU card and the CPU card.

First of all, for non-CPU cards, you must be familiar with the storage structure of the card, where is the manufacturer area, where is the password area, where is the data control area, where is the data area (application area)...; and for the CPU card, you don’t have to care about the data Address, but pay attention to the structure of the file system: main files (MF, equivalent to the root directory of the DOS file system), special files (DF, equivalent to the directory of the DOS file system, can have multiple layers), basic files (EF, It is equivalent to the file of DOS file system).

Although the basic file types of the CPU card have only three types: transparent (binary) files, (fixed length and variable length) linear recording files and cyclic recording files, due to the needs of COS internal control, some specific "variants" are derived-reset Answer file, password file, key file, DIR file, SFI file... These all need to be familiar.

The pure memory card can be read freely; the access control of non-CPU logic encryption card needs to master the password control of the specific card, the authentication control, the specific data control flag byte and the fuse of the card (these Control may not be available).

The access control of the CPU card is defined when the file is created, whether authentication is required for reading, writing, and modification, which key is used, whether a password is required, whether MAC authentication is required, and so on. It should be noted that the format of the file creation command is different with COS. So, you must read his COS manual.

Now talk about card operations. The access of non-CPU cards is generally done directly by calling functions, but you need to be familiar with the calling parameters. In addition to the device commands (testing card, power-on, power-on, card selection, etc.) and reset commands of the CPU card, all card commands are executed through a common command function, so you need to be familiar with the commands in the COS manual.

COS card operation commands have a unified format: CLA (command class), INS (command instruction), P1 (parameter 1), P2 (parameter 2), Lc (command data field Data length), Data and Le (response) Data field length). Except for Data, the command field is a 1-byte hexadecimal number. The data field is a hexadecimal number string, which can be a binary number, BCD code or text ASCII code, etc. This is a bit like assembly language. When calling a command function, just substitute the command string into the corresponding parameter. For more information about non-CPU cards and CPU cards, please pay attention to the technical exchanges of RZX.