The purpose of the application selection is to select an application for the transaction being executed. Step: First create the application candidate list, then select an app from the candidate list. I. Creating a candidate list
Establish a list of applications that are supported by the terminal and the card.
Two methods: Directory selection method and aid list method
1. Catalogue Selection Method:
A. Terminal send Selection ' 1PAY. SYS. FFD01 ' File command, the ICC return data contains a short file identifier (tag ' _ ') B. The read-record command is sent over a short file identifier terminal, until the ICC returns ' 6a83 ', indicating that the record has been read. The ICC return record contains the DF name (tag ' 4F '), which matches the DF name and the terminal's aid to match the conditional join candidate list.
2.AID List Selection Method steps:
Based on the terminal aid list, the aid sequentially obtains the ICC's DF name by selecting a command, matching it to the aid of the card and qualifying for the candidate list.
Match: The exact match and the partial match are two kinds. The exact match is that the terminal aid is exactly the same length and value as the card aid; part of the match is that the card aid begins with a terminal aid, that is, the card's aid must be greater than or equal to the length of the terminal aid. Example: Terminal aid:a0 00 00 03 33 01 01 Card aid1:a0 00 00 03 33 01 01 01 Card aid2:a0 00 00 00 03 10 10 Card aid3:a0 00 00 03 33 01 01 Terminal AI D is exactly the same as the card AID3; Terminal aid is partially matched to the card AID1.
Second, the final selection of applications from the candidate list to select the application ① according to the priority of the application from high to low selection; ② If the priority indicator is applied b8=1, the cardholder chooses the application;
If the b8=0 of the priority indicator is applied, the terminal chooses the application.
iii. Commands used
Select command:
Select command reply: 1. Select the PSE Reply 2. Select the reply for the aid
iv. Examples of application options T: Indicates the command sent by the terminal C: Indicates the data returned by the card red is tag, black is length, purple is value
A. Select the PSE Environment: select 1PAY. SYS. DDF01 file
t:00 A4 0E (2E), 2E 44 44 46 30 31 00
c:6f 0E, 2E, 2E, A5, 5F 2D, 7A, BF, 0C, 9F, 4D, 0B, 0A 90 00
Card Return Data parsing:
6F (0E), 2E, 2E (1PAY). SYS. DDF01) A5 (SFI short file identifier) 5F 2D (Preferred language) 027A (en Chinese) BF 0C 9F 4D 0B 0A (SW1, SW2)
The next step is to read the record, the short file identifier is 01, the preferred language is Chinese
B. Select the PSE Association file by looping through the records
t:00 B2 0C 00 read the first record of the loop file
C:70 1 B, 4F A0, 0A 45 4F 43 20 44 42 49 54 87 01 01 90 00
Card Return Data parsing:
1b61 4F (ADF name) A0 (AID) 50 (Application label) 0A 4F (PBOC DEBIT) 87 (Application priority indicator). (with the use of precedence indicators) 0190 xx (SW1, SW2)
Note: Card return aid is A0 00 00 03 33 01 01 01; Application Priority is 01
Read the Loop file 2nd record
t:00 B2 0C 00
C:6A 83 (record not found)
C. Selecting a File
According to the directory name (AID) selection, the directory is the current directory itself, peer or subordinate
t:00 A4 A0 00 00 03 33 01 01 01 00
c:6f A0, A5, 0A, 4F, and more. 9F, 9F, 7A, 9F, 5F, 2A, and more. 5F 2D 7A (BF) 0C 9F 4D 0B 90 00
Card Return Data parsing:
6F A0 (AID) A5 2850 (Application label) 0a50 4F (PBOC DEBIT) 87 (Application priority indicator) 0101 9F 38 (app-level) (PODL) 9F 7A, 9F, 5F 2A 025F 2D (Preferred language) 027A, BF 0C, 9F 4D, 0B 0A, XX (SW1, SW2)
Pdol 9F 7A 9F, 5F 2A