It is not easy for users to develop their application program according ISO-7816 standard, user should know detail command format, computing cryptography .. etc. That is why Unitech provide this manual and utility library to help user to develop application program by simple API.
Page 3
Demo disk All necessary files are included into demo disk, you can find it from sub-directory Smart Card of DEMO disk. It includes SAMPLE01.c – sample program for issuing new Smart Card SAMPLE02.c – sample program for reading / writing Smart Card Function library GEMSmart Card.LIB –...
Introduction:...2 Table of contents : ...4 Chapter 1. System architecture...6 System diagram : ... 6 Relationship between Smart Card function Library and System call :... 7 Developing flow for user application program ... 8 Chapter 2. System function call (Firmware function call): ...9 Check Smart Card...
Although, there are variety of smart cards on the market to provide a design reference, Unitech develops an Smart Card library to provide all MPCOS-EMV command set, so user can directly use those function libraries to develop their application program without knowing detailed low level control register and data structure.
1.2 Relationship between Smart Card function Library and System function call Below diagram show relationship between Smart Card function library and system function call. The function call inside the black frame are only available for MPCOS-EMV card, other function library follow ISO 7816 standard. In this diagram, F/W means MR350MKII system function call. S_CHK_ICC S_OPEN_ICC F_CHK_ICC...
1.3 Developing flow for user application program Below diagram is a flow chart for developing Smart Card application program. Check Smart Card is inserted ? (AH=0) Power on Smart Card (AH=1) Exchange message (AH=3) Power off Smart Card (AH=2) Check Smart Card is removed ? According above diagram, user should follow this flow chart to develop their application program.
Chapter 2. System function call (Firmware function call): Below 3 system function calls are implemented on the Firmware of MR350MKII. Those function call only support short format and protocol are available for T=0 and T=1. All of the system function calls are implemented on system interrupt vector 06H (INT 06H) 3.1 Check Smart Card In Smart Card reader, there is a detector to check whether Smart Card is inserted.
2.2 Power-on Smart Card This function informs Smart Card reader to supply power to VCC pin on Smart card and it also needs to send pointer of ATR (Answer to reset) structure to get its status Entry Parameter INT 06H AH = 1 POWER ON Smart Card ES:DI=...
2.3 Power off Smart Card Entry parameter INT 06H AH = 2 ; POWER OFF Smart Card 2.4 Exchange message This function is used to send or receive data between MR350MKII and Smart Card Entry parameter INT 06H AH = 3 ;SEND COMMAND TO Smart Card DS:SI= buffer ;...
Chapter 3. Function library This chapter introduces whole function library by function name sequence. It includes function description, input/output parameter and data structure. This C function library can be included into user’ s application program and please use LARGE MEMORY MODEL to compile it. 3.1 Files description of Smart Card function library There are 4 files in our function library.
3.2 F_APD_REC This function writes data and initializes a record EF. When secure messaging is used, the function dose not accept this command of length greater than the communication buffer size(64 bytes). Compatible with ISO7816 or Gemplus command set IS7816 if class = normal Genplus if class = secure Function call...
3.3 F_CHK_ICC This function is used to check Smart Card current stage. Compatible with ISO7816 or Gemplus command set Function call void F_CHK_ICC( S_CHK_ICC* ); Data structure of S_CHK_ICC typedef struct int ChkPower; int ChkPresent; } S_CHK_ICC; Input parameter : Output parameter :.
3.5 F_CRT_DF This function creates a dedicated File. User should use function F_INI_ACC to load Access Condition before creates DF/EF. Compatible with ISO7816 or Gemplus command set Gemplus Function call void F_CRT_DF( S_CRT_DF* ); Data structure of S_CRT_DF typedef struct int Class;...
3.6 F_CRT_EF This function creates an Elementary File. User should use function F_INI_ACC to load Access Condition before creates DF/EF. Compatible with ISO7816 or Gemplus command set Gemplus Function call void F_CRT_EF( S_CRT_EF* ); Data structure of S_CRT_EF typedef struct int Class;...
3.7 F_ERR_MSG Convert Smart Card reader return code to text description Compatible with ISO7816 or Gemplus command set Parital Function call void F_ERR_MSG( unsigned char* p_sw ,unsigned char* msg); Input parameter : P_sw : point to status word. Output parameter : : string buffer of text description...
3.8 F_EX_APDU This function call exchanges APDU command with Smart Card and returns the card’ s response. Compatible with ISO7816 or Gemplus command set Function call void F_EX_APDU( S_EX_APDU* ); Data structure of S_EX_APDU typedef struct int InLen; unsigned char InApdu[MaxAPDU]; int OutLen;...
3.9 F_INI_ACC This function initializes the Access Conditions registers, which is pre-requisite for creation of EF or DF. Before useing function “F_CRT_EF” or “F_CRT_DF”. User should initializes Access Conditions registers. Access Conditions registers will reset to 0 when function “F_OPEN_ICC” or “F_SEL_ID”...
3.11 F_LD_KEY This function loads/updates a triple DES key into a key file. Compatible with ISO7816 or Gemplus command set Gemplus Function call: void F_LD_KEY( S_LD_KEY* ); Data structure of S_LD_KEY typedef struct int Class; int Mode; unsigned char ShortId; int KeyNum;...
3.12 F_LD_SC This function loads a code into secret code file. Compatible with ISO7816 or Gemplus command set Gemplus Function call void F_LD_SC( S_LD_SC* ); Data structure of S_LD_SC typedef struct int Class; int Mode; unsigned char ShortId; int CodeNum; int CodeType;...
3.13 F_LIB_VER This function is used to get library version . Compatible with ISO7816 or Gemplus command set Function call void F_LIB_VER( int* main, int* extend ); Input parameter : Output parameter : Main : store main version of library. Extend : store extend version of library.
3.14 F_OPEN_ICC Reset Smart Card and get Answer To Reset. This function sets Access Condition 1,2 and 3 to zero. Compatible with ISO7816 or Gemplus command set Function call void F_OPEN_ICC( S_OPEN_ICC* ); Data structure of S_OPEN_ICC typedef struct int Smart CardType; int AtrReady;...
3.15 F_RD_BIN This function is used to read a continuous block of bytes in a transparent EF. When secure messaging is used the function dose not accept the Read command of length greater than the communication buffer size(64 bytes). Compatible with ISO7816 or Gemplus command set IS7816 if class = normal Genplus if class = secure...
3.16 F_RD_REC This function is used to read data from a record EF. When secure messaging is used this function dose not accept this command of length greater than the communication buffer size(64 bytes). Compatible with ISO7816 or Gemplus command set IS7816 if class = normal Genplus if class = secure...
3.17 F_SEL_FKEY Computes a temporary administration key using a specified key. The temporary administration key is used for secure messaging. Only one temporary key is allowed at a given time. Compatible with ISO7816 or Gemplus command set Genplus Function call void F_SEL_FKEY( S_SEL_FKEY* );...
3.18 F_SEL_ID This function allows you to select the Master File, a Dedicated File, or an Elementary File using its Identifier. The Get Response command is chained to retrieve the file descriptor. This function will set access condition register 1,2 and 3 to zero. Compatible with ISO7816 or Gemplus command set ISO 7816 Function call...
3.19 F_SET_FKEY This function is used to set temporary session key which has been established by function “F_SEL_FKEY”. Compatible with ISO7816 or Gemplus command set Genplus Function call void F_SET_FKEY( S_SEL_FKEY* GG ,unsigned char* key ) Input parameter : : a structure pointer and it is previously returned by function “F_SEL_FKEY”.
3.20 F_SET_SC This function unlocks/changes a secret code in the secret code file under the currently selected DF. There is no limit to the number of times that a secret code can be unlocked/changed. Compatible with ISO7816 or Gemplus command set Genplus Function call void F_SET_SC( S_SET_SC* );...
3.21 F_UPD_BIN This function updates data in a transparent EF. When secure messaging is used the dose not accept this command of length greater than the communication Compatible with ISO7816 or Gemplus command set IS7816 if class = normal Genplus if class = secure Function call Void F_UPD_BIN( S_UPD_BIN* );...
3.22 F_UPD_REC This function updates data to a record EF. When secure messaging is used the function dose not accept this command of length greater than the communication buffer size(64 bytes). Compatible with ISO7816 or Gemplus command set IS7816 if class = normal Genplus if class = secure Function call void F_UPD_REC( S_UPD_REC* );...
3.23 F_VERIFY This function presents a code to the card. Compatible with ISO7816 or Gemplus command set IS7816 if class = normal Genplus if class = secure Function call void F_VERIFY( S_VERIFY* ); Data structure of S_VERIFY typedef struct int Class; int ScNumber;...
3.24 F_WR_BIN This function writes data to a transparent EF. When secure messaging is used the function dose not accept this command of length greater than the communication buffer size(64 bytes). Compatible with ISO7816 or Gemplus command set IS7816 if class = normal Genplus if class = secure Function call Void F_WR_BIN( S_UPD_BIN* );...