EMV Application Specification :: Application selection

EMV Application Specification :: Application selection

The first step in EMV transaction flow is Application selection.

Check out the previous article for overview about EMV transaction flow:

https://www.dhirubhai.net/pulse/emv-application-specification-closer-look-ahmed-hemdan-farghaly/

An EMV card may have several applications [Credit, ATM, Loyalty...]

And every terminal have a list of supported applications of it's own. [terminal support local & international card schemes like Meeza, visa, and MasterCard].

The goal in this step is to select one application that is supported by terminal and card , this is done using one of 2 methods:


Using a list of AIDs [terminal supported AIDs]:

The terminal shall maintain a list of applications supported by the terminal identified by their AIDs.

In this method, the terminal will try to select all the supported AIDs and build a list of applications [candidate list].

This is done by issuing a select command using every AID file name that it supports.

Below is an example of a terminal tried to select several local and international card schemes but only succeed to select local card scheme (meeza) :

CMD : 00 A4 04 00 07 A0000000031010 00

RSP : 6A82 [response means selected file not found]

CMD : 00 A4 04 00 07 A0000000031020 00

RSP : 6A82

CMD : 00 A4 04 00 07 A0000000032010 00

RSP : 6A82

CMD : 00 A4 04 00 07 A0000000044010 00

RSP : 6A82

CMD : 00 A4 04 00 07 A0000000041010 00

RSP : 6A82

CMD : 00 A4 04 00 07 A0000000046000 00

RSP : 6A82

CMD : 00 A4 04 00 07 A0000000043060 00

RSP : 6A82

CMD : 00 A4 04 00 08 A000000732100123 00

RSP : 6F318408A000000732100123A52550056D65657A615F2D046172656E9F1101069F12056D65657A61870101BF0C059F4D02151E 9000

only when select command is successful (SW1 SW2 = 9000), the AID is added to the candidate list.


Payment System Environment (PSE) method:

PSE contains a list of applications available on the card.

In that case terminal will choose to select from the PSE list not all the supported AIDs that it knows, this is much faster as the terminal will already know the AIDs supported by the card beforehand.

This is done by issuing a select command using a special application name (1PAY.SYS.DDF01):

00 A4 04 00 0E 315041592E5359532E4444463031 00

6F20840E315041592E5359532E4444463031A50E8801015F2D046172656E9F110106 9000

Only when select command is successful (SW1 SW2 = 9000), that means card support PSE.

From the data returned in response to select command, terminal extract the short file identifier (SFI) [tag 88]

Terminal will use SFI to issue read commands (starting from 0x01 in our example) to read all PSE information available.

CMD : 00B2010C00

RSP : 701E611C4F08A00000073210012350056D65657A619F12056D65657A61870101 9000

CMD : 00B2020C00

RSP : 6A83 [indicates that the record number requested does not exist]

Only terminal supported AIDs retrieved in the above read command responses will be added to the candidate list.


The final step would be the final selection, which is of 3 cases:

1- there was no mutually support applications added to the candidate list [which means that none of the applications availble on the card are matched with one of the AIDs supported by the terminal], then the terminal will terminate the card session, and this concludes our journey with that card.

2- there was only one mutually support application added to the candidate list, then the terminal will select this application.

[only if Application Priority Indicator "tag 87" is present and bit8 of it's value = '1', the terminal shall requests confirmation and selects the application if the cardholder approves].

3- there were several mutually supported applications added to the candidate list, then the terminal will have 2 options.

   - either present all the supported applications to the cardholder to make the final selection. [preferred method]

   - or the terminal makes the selection based on the Application Priority Indicator .

[this option should not be used if one or more of the mutually supported applications' Application Priority Indicator is present and bit8 of it's value = '1']


Next step will be initiating and Reading the selected application data.


Jensen Louise L.

Mobile Developer (Android, iOS, KMM/KMP) | Payment Card | EMV | ISO 8583 | EFTPOS | EMV L3 Certification (Mastercard M-TIP, Visa ADVT, AMEX Global AEIPS/Expresspay, JCB TCI/TCI-CL, UnionPay Function Test, BancNet)

6 天前

You didn't mentioned that Application Selection Indicator (ASI) is used by the terminal as the matching criterion for list of AIDs.

回复
Yehor Semeniaka

C/C++ Software Developer - Ingenico

3 年

Helllo Ahmed Hemdan Farghaly, I understood the flow, thank you very much! But I can't understand the response in case of AID choosing. 9000 means success, but there are a lot of bytes with the success code. What do they mean? 6F318408A000000732100123A52550056D65657A615F2D046172656E9F1101069F12056D65657A61870101BF0C059F4D02151E

回复
Ravi P.

Security @ GoDaddy

4 年

Thanks for this!

Micheal Mokhtar

Head of Acquiring Business @ Credit Agricole Egypt | Payment Acceptance

4 年

Extremely great content . Thanks for sharing

回复
Andrew M.

Digital Payment Systems Consultant @ Ministry of Finance | MBA in Strategic Management

4 年

Ahmed Hemdan Farghaly I like this one..

要查看或添加评论,请登录

Ahmed Hemdan Farghaly的更多文章

社区洞察

其他会员也浏览了