You are on page 1of 52

M/Chip Advance

Common Personalization Specification


Version 1.2.1 – August 2016
Proprietary Rights

The information contained in this document is proprietary and confidential to


MasterCard International Incorporated, one or more of its affiliated entities
(collectively “MasterCard”), or both.

This material may not be duplicated, published, or disclosed, in whole or in part,


without the prior written permission of MasterCard.

Please ensure that you have signed an M/Chip™ Development Agreement and
have any other relevant license before developing a product.

Trademarks

Trademark notices and symbols used in this manual reflect the registration status
of MasterCard trademarks in the United States. Please consult with the Customer
Operations Services team or the MasterCard Law Department for the registration
status of particular product, program, or service names outside the United States.

All third-party product and service names are trademarks or registered


trademarks of their respective owners.

Disclaimer

Implementation of this M/Chip Advance Common Personalization Specification


requires a separate license from MasterCard and may require a license from third
party intellectual property owners.

MasterCard makes no representations or warranties of any kind, express or


implied, with respect to the contents of this Specification. Without limitation,
MasterCard specifically disclaims all representations and warranties with respect
to the Specification and any intellectual property rights subsisting therein or any
part thereof, including but not limited to any and all implied warranties of title,
non-infringement, or suitability for any purpose (whether or not MasterCard has
been advised, has reason to know, or is otherwise in fact aware of any
information). Without limitation, MasterCard specifically disclaims all
representations and warranties that any practice or implementation of the
Specification will not infringe any third party patents, copyrights, trade secrets or
other rights. Without limitation, MasterCard specifically disclaims all
representations and warranties in relation to the Specifications, including but not
limited to any and all implied warranties of suitability for any purpose (whether
or not MasterCard has been advised, has reason to know, or is otherwise in fact
aware of any information) or achievement of any particular result.

MasterCard Worldwide
Chaussée de Tervuren, 198A
B-1410 Waterloo
Belgium

Email: chip_help@mastercard.com

www.mastercard.com

©2016 MasterCard – Proprietary and Confidential


M/Chip Advance Common Personalization Specification  August 2016 Page 2
Table of Contents

Table of Contents
Table of Contents ........................................................................ 3
1 Using This Manual................................................................. 6
1.1 Purpose ................................................................................................................. 6
1.2 Audience ............................................................................................................... 6
1.3 Related Information .............................................................................................. 6
1.4 Abbreviations........................................................................................................ 7
1.5 Notational Conventions ........................................................................................ 8
1.5.1 Hexadecimal Notational Convention .......................................................... 8
1.5.2 Binary Notational Convention .................................................................... 8
1.5.3 Decimal Notational Convention ................................................................. 8
1.5.4 Data Object Notational Convention............................................................ 9
1.5.5 State Notational Convention ....................................................................... 9
1.5.6 C-APDU Notational Convention ................................................................ 9
1.6 Data Object Format............................................................................................... 9
2 Implementation of EMV Card Personalization .................. 10
2.1 Overview............................................................................................................. 10
2.2 Direct Method ..................................................................................................... 10
2.3 Personalization State Machine for EMV Card Personalization .......................... 10
2.3.1 Application Selection Use of the Personalization Flag ............................ 12
2.3.2 Personalized Application States ............................................................... 13
2.3.3 Non-Personalized Application States ....................................................... 13
2.4 Select................................................................................................................... 15
2.4.1 Select Command Message ........................................................................ 15
2.4.2 Select Response Message ......................................................................... 15
2.4.3 Status Bytes .............................................................................................. 16
2.5 Initialize Update.................................................................................................. 17
2.5.1 Initialize Update Command Message ....................................................... 17
2.5.2 Initialize Update Response Message ........................................................ 17
2.5.3 Status Bytes .............................................................................................. 18
2.6 External Authenticate ......................................................................................... 19
2.6.1 External Authenticate Command Message ............................................... 19
2.6.2 External Authenticate Response Message ................................................ 19
2.6.3 Status Bytes .............................................................................................. 20
2.7 Store Data ........................................................................................................... 21
2.7.1 Store Data Command Message ................................................................. 21
2.7.2 Store Data Response Message .................................................................. 23
2.7.3 Status Bytes .............................................................................................. 23
2.8 Data Groupings ................................................................................................... 24
2.8.1 Grouped Data Groupings .......................................................................... 24
2.8.2 Order of Data Groupings .......................................................................... 24
2.8.3 Version Control ........................................................................................ 24
2.8.4 M/Chip Advance Data Groupings ............................................................ 24
2.8.5 Vendor Discretionary Data Groupings ..................................................... 24

©2016 MasterCard – Proprietary and Confidential Page 3


M/Chip Advance Common Personalization Specification  August 2016
Table of Contents

3 Data Grouping Structures................................................... 26


3.1 Overview............................................................................................................. 26
3.2 Data Groupings Reserved for Record Values ..................................................... 26
3.3 Files with SFI between 1 and 10......................................................................... 27
3.4 Files with SFI between 11 and 20....................................................................... 27
3.5 Files with SFI between 21 and 30....................................................................... 28
3.6 Dynamic Allocation of Record Memory ............................................................ 28
4 RSA Key Format and Data Grouping Encryption .............. 29
4.1 Key Format ......................................................................................................... 29
4.2 Encrypted Data Groupings ................................................................................. 29
5 DGI Definitions .................................................................... 30
5.1 DGI '0E01' to '0EFF' – Data Storage Records .................................................... 30
5.2 DGI '8000' – Contact Keyset .............................................................................. 30
5.3 DGI '8001' – Contactless Keyset ........................................................................ 30
5.4 DGI '8004' – AC Master Key (MAS4C) ............................................................ 31
5.5 DGI '8010' – Reference PIN Block..................................................................... 31
5.6 DGI '8201' – ICC Private Key CRT constant q-1 mod p ..................................... 31
5.7 DGI '8202' – ICC Private Key CRT constant d mod (q - 1) ............................... 32
5.8 DGI '8203' – ICC Private Key CRT constant d mod (p - 1) ............................... 32
5.9 DGI '8204' – ICC Private Key CRT constant prime factor q ............................. 32
5.10 DGI '8205' – ICC Private Key CRT constant prime factor p ............................. 33
5.11 DGI '8301' – ICC PIN Encipherment Private Key CRT constant q-1 mod p ...... 33
5.12 DGI '8302' – ICC PIN Encipherment Private Key CRT constant d mod (q - 1) 34
5.13 DGI '8303' – ICC PIN Encipherment Private Key CRT constant d mod (p - 1) 34
5.14 DGI '8304' – ICC PIN Encipherment Private Key CRT constant prime factor q
34
5.15 DGI '8305' – ICC PIN Encipherment Private Key CRT constant prime factor p
35
5.16 DGI '8400' – Contact KDCVC3 ......................................................................... 35
5.17 DGI '8401' – Contactless KDCVC3 ................................................................... 35
5.18 DGI '9102' – SELECT Response Data – FCI Proprietary Template .................. 36
5.19 DGI '9010' – PIN Related Data........................................................................... 36
5.20 DGI 'A002' – Common Risk Management Parameters ...................................... 36
5.21 DGI 'A004' – Public Key Length ........................................................................ 37
5.22 DGI 'A005' – Contact Get Processing Options Response .................................. 37
5.23 DGI 'A006' – Contact ICC Dynamic Number Master Key ................................ 38
5.24 DGI 'A007' – Application Status and ATC Limit ............................................... 38
5.25 DGI 'A008' – PIN Decipherments Error Counter Limit ..................................... 38
5.26 DGI 'A009' – Application Life Cycle Data......................................................... 38
5.27 DGI 'A00A' – Last Online Transaction Date ...................................................... 39
5.28 DGI 'A00E' – Data Storage Configuration ......................................................... 39
5.29 DGI 'A012' – Contact Risk Management Parameters......................................... 39
5.30 DGI 'A013' – Application Control (Contact) ...................................................... 40

©2016 MasterCard – Proprietary and Confidential Page 4


M/Chip Advance Common Personalization Specification  August 2016
Table of Contents

5.31 DGI 'A014' – Read Record Filter (Contact) ....................................................... 40


5.32 DGI 'A015' – Card Issuer Action Codes (Contact) ............................................. 40
5.33 DGI 'A016' – Contactless ICC Dynamic Number Master Key .......................... 40
5.34 DGI 'A017' – Contact 3DES Key Information ................................................... 41
5.35 DGI 'A022' – Contactless Risk Management Parameters................................... 41
5.36 DGI 'A023' – Application Control (Contactless) ................................................ 41
5.37 DGI 'A024' – Read Record Filter (Contactless) ................................................. 42
5.38 DGI 'A025' – Card Issuer Action Codes (Contactless) ....................................... 42
5.39 DGI 'A027' – Contactless 3DES Key Information ............................................. 42
5.40 DGI 'A028' – MAS4C 3DES Key Information .................................................. 42
5.41 DGI 'B002' – Log Configuration ........................................................................ 43
5.42 DGI 'B005' – Contactless Get Processing Options Response ............................. 43
5.43 DGI 'B010' – Contact IVCVC3 .......................................................................... 43
5.44 DGI 'B011' to 'B015' – Protected Data Envelopes .............................................. 44
5.45 DGI 'B016' to 'B01A' – Unprotected Data Envelopes ........................................ 44
5.46 DGI 'B023'– Contactless IVCVC3 ..................................................................... 44
5.47 DGI 'B100' – Contact Relay Resistance Protocol Parameters ............................ 45
5.48 DGI 'B101' – Contactless Relay Resistance Protocol Parameters ...................... 45
5.49 DGI 'B102' – Linked Application Index ............................................................. 45
6 Profile Data Groupings ....................................................... 46
6.1 Conditional Data Groupings ............................................................................... 46
6.2 Data Grouping for Each M/Chip Advance Product ............................................ 47

©2016 MasterCard – Proprietary and Confidential Page 5


M/Chip Advance Common Personalization Specification  August 2016
Using This Manual
Purpose

1 Using This Manual


1.1 Purpose
The M/ChipTM Advance Common Personalization Specification defines how the
M/Chip Advance application is personalized in accordance with the EMV Card
Personalization Specification.

1.2 Audience
MasterCard provides this manual for customers and their authorized agents.
Specifically, the following personnel should find this manual useful:
 Card application developers
 Card application personalizers
 Data preparation bureaus

1.3 Related Information


The following references are used in this document. The latest version applies unless
a publication date is explicitly stated.

[EMV CPS] EMV Card Personalization Specification


[MCA] M/Chip Advance Card Application Specification, Payment and
Data Storage, Version 1.2.1
M/Chip Advance Card Application Specification, Payment,
Version 1.2.1
[MCA PD] M/Chip Advance Product Derivation, Version 1.3.1

©2016 MasterCard – Proprietary and Confidential Page 6


M/Chip Advance Common Personalization Specification  August 2016
Using This Manual
Abbreviations

1.4 Abbreviations
Table 1.1 contains the abbreviations used in this document.

Table 1.1—Abbreviations

Abbreviation Description
AC Application Cryptogram
AID Application Identifier
an Alphanumeric characters
ans Alphanumeric and special characters
ARPC Authorization Response Cryptogram
ASCII American Standard Code for Information Interchange
ATC Application Transaction Counter
b Binary
BCD Binary Coded Decimal
C-APDU Command Application Protocol Data Unit
CBC Cipher Block Chaining
CDOL Card Risk Management Data Object List
CLA Class byte of command message
cn Compressed numeric
CRM Card Risk Management
CRT Chinese Remainder Theorem
CVM Cardholder Verification Method
DES Data Encryption Standard
DGI Data Grouping Identifier
DS Data Storage
DSPK Data Storage Partial Key
ECB Electronic Code-Book
EMV Europay MasterCard Visa
ENC Encryption Personalization Instructions
FCI File Control Information
ICC Integrated Circuit Card
IDS Integrated Data Storage
IPK Issuer Public Key
ISO International Standards Organisation
IVCVC3 Initialization Vector for CVC3 generation
KDCVC3 ICC Derived Key for CVC3 generation

©2016 MasterCard – Proprietary and Confidential Page 7


M/Chip Advance Common Personalization Specification  August 2016
Using This Manual
Notational Conventions

Abbreviation Description
Lc Number of bytes present in the data field of the C-APDU
MAC Message Authentication Code
MCADP-C M/Chip Advance Derived Product - Contact Only
MCADP-CL M/Chip Advance Derived Product - Contactless Only
MCADS M/Chip Advance Payment & Data Storage
MCAP M/Chip Advance Payment
MTA Maximum Transaction Amount
n Numeric
OS Operating System
P1 Parameter 1
PIN Personal Identification Number
RRP Relay Resistance Protocol
RSA Rivest, Shamir, Adleman
SFI Short File Identifier
SKUDEK Personalization Session Key for Key and PIN Encryption
SMC Secure Messaging for Confidentiality
SMI Secure Messaging for Integrity
SW1-SW2 Status bytes 1-2
TLV Tag Length Value

1.5 Notational Conventions

1.5.1 Hexadecimal Notational Convention


Values expressed in hexadecimal form are enclosed in single quotes.
For example, 27509 decimal is expressed in hexadecimal as '6B75'.

1.5.2 Binary Notational Convention


Values expressed in binary form are followed by a b.
For example, '08' hexadecimal is expressed in binary as 00001000b.

1.5.3 Decimal Notational Convention


Values expressed in decimal form are not enclosed in single quotes.
For example, '08' hexadecimal is expressed in decimal as 8.

©2016 MasterCard – Proprietary and Confidential Page 8


M/Chip Advance Common Personalization Specification  August 2016
Using This Manual
Data Object Format

1.5.4 Data Object Notational Convention


Data objects used for this specification are written in italics to distinguish them from
the text.
To refer to a specific bit of a single byte multi-bit data object, a bit index is used
within brackets [_].
For example, P1[7] represents the 7th bit of the P1. The first bit (rightmost or least
significant) of a data object has index 1.
Ranges of bits are expressed with the [y : x] notational convention.
For example, P1[5 : 1] represents bits 5, 4, 3, 2, and 1 of P1.

1.5.5 State Notational Convention


The application states of the M/Chip Advance application are written in a specific
format to distinguish them from the text:
state
Example:
selected

1.5.6 C-APDU Notational Convention


The C-APDUs supported by the M/Chip Advance application are written in a specific
format to distinguish them from the text:
COMMAND
Example:
STORE DATA

1.6 Data Object Format


Data objects that have the numeric (n) format are BCD encoded, right justified with
leading hexadecimal zeros. Data objects that have the compressed numeric (cn)
format are BCD encoded, left justified and padded with trailing 'F's. Note that the
length indicator in the numeric and compressed numeric format notational
conventions (e.g. n 4) specifies the number of digits and not the number of bytes.
Data objects that have the alphanumeric (an) or alphanumeric special (ans) format are
ASCII encoded, left justified and padded with trailing hexadecimal zeros.

©2016 MasterCard – Proprietary and Confidential Page 9


M/Chip Advance Common Personalization Specification  August 2016
Implementation of EMV Card Personalization
Overview

2 Implementation of EMV Card


Personalization
2.1 Overview
This chapter provides information required by application developers to implement
EMV Card Personalization on M/Chip Advance.

2.2 Direct Method


[EMV CPS] defines two methods of establishing secure personalization channels:
indirect and direct. The M/Chip Advance application must support the direct method.
This method assumes a single security zone between the data preparation and the
M/Chip Advance application and allows pre-computing of the APDU commands in
the data preparation system.

状态机
2.3 Personalization State Machine for EMV Card
Personalization
The addition of the personalization commands to the M/Chip Advance application
introduces new states to its state machine, to support the "personalization" phase.
The M/Chip Advance application has two distinct phases, each with its own state
machine:
 The personalization state machine, defined in this specification
 The operational state machine defined in [MCA] and [MCA PD].
The "personalization" phase starts when the M/Chip Advance application has been
installed and initialized.

©2016 MasterCard – Proprietary and Confidential Page 10


M/Chip Advance Common Personalization Specification  August 2016
Implementation of EMV Card Personalization
Personalization State Machine for EMV Card Personalization

Figure 2-1—M/Chip Advance Personalization State Machine

Select : Else

idle
Select : '9000'
And PF=1b
Select : '9000' Select : '9000' and interface
And PF=0b And PF=1b enabled
and interface
disabled

Selected

Selected not Selected not


selected
personalized enabled

Last Store
Initialize Update : data : '9000'
Else
'9000' and interface
disabled Last Store
data : '9000'
initialized and interface
enabled

Else External
Authenticate : '9000'

M/Chip Advance
Card Application
Specification

personalizing Last Store Data

Store Data
: '9000' or '6A88'

The following sections describe how the M/Chip Advance application identifies which
phase (personalization or operational) it is in, and which states are applicable to each
phase.

©2016 MasterCard – Proprietary and Confidential Page 11


M/Chip Advance Common Personalization Specification  August 2016
Implementation of EMV Card Personalization
Personalization State Machine for EMV Card Personalization

2.3.1 Application Selection Use of the Personalization Flag


[MCA] describes how the personalized M/Chip Advance applications reach the
selected or selectednotenabled state when it receives a SELECT signal
from the multi-application manager. However, the processing of the SELECT signal
is different when M/Chip Advance is not personalized. After processing the SELECT
signal, a non-personalized M/Chip Advance application will go to the
selectednotpersonalized state.
Therefore, in order for the M/Chip Advance application to process the SELECT signal
correctly, it must identify if personalization has taken place. It does so using the
Personalization Flag, a persistent data object consisting of a single bit. Table 2.1
describes the settings for the Personalization Flag.

Table 2.1—Personalization Flag Settings


b1 Meaning
0b M/Chip Advance not personalized.
1b M/Chip Advance personalized.

The M/Chip Advance application manages the Personalization Flag as follows:


 Before the M/Chip Advance application is personalized, the Personalization
Flag has a value of 0b. In this case, when the M/Chip Advance application
receives a SELECT signal, it will go to the selectednotpersonalized
state and the personalization state machine will apply.
 The last personalization C-APDU processed by the M/Chip Advance
application, that is, the last STORE DATA command, sets the Personalization
Flag to 1b.
 When the M/Chip Advance application is already personalized, the
Personalization Flag has a value of 1b. In this case, when the M/Chip
Advance application receives a SELECT signal, it will go to the selected
or selectednotenabled, and the operational state machine specified in
[MCA] applies.
The M/Chip Advance application can never reset the Personalization Flag. Once the
last STORE DATA processed by the M/Chip Advance application sets the
Personalization Flag to 1b, any further personalization commands are disabled.
The Personalization Flag is an internal flag with no external visibility. Providing the
external behavior of the M/Chip Advance application remains indistinguishable from
the behavior defined in these specifications, you may choose an alternative
implementation of the functionality achieved with the Personalization Flag. For
example, you may implement the functionality with a lower layer such as the card
operating system (OS), or with the multi-application manager.
Whatever form your implementation takes, the application switch between
personalization phase and operational phase must be triggered by the last STORE
DATA (P1[8] = 1b).

©2016 MasterCard – Proprietary and Confidential Page 12


M/Chip Advance Common Personalization Specification  August 2016
Implementation of EMV Card Personalization
Personalization State Machine for EMV Card Personalization

2.3.2 Personalized Application States


When the M/Chip Advance application is in its operational phase (that is,
personalized), it can reach the states defined in [MCA], described below in Table 2.2.

Table 2.2—Application States Reached by a Personalized Application

State Description
idle Application is not currently selected
selected Application is selected and enabled
selectednotenabled Application is selected but is not enabled
initiated Transaction is initiated
online Application expects a connection with
the issuer
script Application is ready to accept a script
command from the issuer

2.3.3 Non-Personalized Application States


The addition of the personalization phase implies that the M/Chip Advance
application requires new states. The M/Chip Advance application uses these
personalization states during personalization, and uses the operational states defined
in [MCA] after personalization.

Table 2.3—Application States Reached by an Application Not Personalized

State Description
idle Application is not currently selected.
selectednotpersonalized Application is selected, but not personalized.
initialized Personalization is initialized
personalizing Application expects personalization values from
STORE DATA C-APDUs

2.3.3.1 Idle State


The M/Chip Advance application is in the idle state when it is inactive. This state is
the idle state defined in [MCA].
The only C-APDU that the M/Chip Advance application handles in this state is the
SELECT C-APDU. This C-APDU, represented as the SELECT signal, activates (that
is, selects) the application.

©2016 MasterCard – Proprietary and Confidential Page 13


M/Chip Advance Common Personalization Specification  August 2016
Implementation of EMV Card Personalization
Personalization State Machine for EMV Card Personalization

2.3.3.2 Selectednotpersonalized State


The M/Chip Advance application goes to the selectednotpersonalized state,
in each of the following situations:
 When it is activated (that is, the first SELECT signal) and not yet
personalized.
 When INITIALIZE UPDATE or EXTERNAL AUTHENTICATE fails when
starting the personalization session.
 When a new personalization session is started (that is, the SELECT signal).
This should never be used as the M/Chip Advance application should be
personalized in a single session.
 When personalization is aborted, that is, whenever SW1-SW2 is not '9000' or
'6A88' for the STORE DATA.
When in the selectednotpersonalized state, the M/Chip Advance application
only handles the INITIALIZE UPDATE C-APDU. This command initiates a new
personalization session.

2.3.3.3 Initialized State


The M/Chip Advance application goes to the initialized state after successful
processing of the INITIALIZE UPDATE C-APDU. In this state, a new
personalization session is initialized.
In the initialized state, the M/Chip Advance application only handles the
EXTERNAL AUTHENTICATE C-APDU. This C-APDU is used to create a secure
channel between the M/Chip Advance application and the personalization device.

2.3.3.4 Personalizing State


The M/Chip Advance application goes to the personalizing state after successful
processing of the EXTERNAL AUTHENTICATE C-APDU. In this state, the
application is ready to receive personalization values through a series of STORE
DATA C-APDUs.
The STORE DATA keeps the application in the personalizing state so that a
sequence of STORE DATA commands can be used to personalize the entire
application.
The last STORE DATA has a specific meaning. It completes the personalization and
terminates the application's ability to process STORE DATA. The state reached by
the M/Chip Advance application after the last STORE DATA can be one of the
following:
 idle
 selected or selectednotenabled
 selectednotpersonalized
 personalizing

©2016 MasterCard – Proprietary and Confidential Page 14


M/Chip Advance Common Personalization Specification  August 2016
Implementation of EMV Card Personalization
Select

The implementer may select the destination state for the last STORE DATA.
MasterCard recommends the destination state idle.

2.4 Select
The SELECT command is used to select the application to be personalized.

2.4.1 Select Command Message


The SELECT command message is specified in Table 2.4.

Table 2.4—Select Command Message

Code Value
CLA '00'
INS 'A4'
P1 '04'
P2 '00'
Lc '05 to '10'
Data AID to be selected
Le '00'

2.4.2 Select Response Message


Before completion of the personalization, the response to the SELECT command is
the pre-personalization FCI and SW1-SW2 = '9000'. The pre-personalization FCI is
not interpreted by the personalization device. As a consequence, the value of the pre-
personalization FCI is left to the implementation. The pre-personalization FCI may
follow the '6F' template. It may even be empty (that is, the response only consists of
SW1-SW2).
The SELECT response message is specified in Table 2.5.

Table 2.5—Select Response Message

Field Length
FCI Template (optional) Var

©2016 MasterCard – Proprietary and Confidential Page 15


M/Chip Advance Common Personalization Specification  August 2016
Implementation of EMV Card Personalization
Select

2.4.3 Status Bytes


The status bytes that may be sent in response to the SELECT command are listed in
Table 2.6.

Table 2.6—Status Bytes for Select Command

SW12 Meaning
'9000' Successful command processing
'6A82' Application not found

©2016 MasterCard – Proprietary and Confidential Page 16


M/Chip Advance Common Personalization Specification  August 2016
Implementation of EMV Card Personalization
Initialize Update

2.5 Initialize Update


The INITIALIZE UPDATE command is the first command issued to the card after
the personalization device selects the application. INITIALIZE UPDATE is used to
establish the secure channel session to be used during personalization.
Refer to [EMV CPS] for complementary description of the INITIALIZE UPDATE
command.

2.5.1 Initialize Update Command Message


The INITIALIZE UPDATE command message is specified in Table 2.7.

Table 2.7—Initialize Update Command Message

Code Value
CLA '80'
INS '50'
P1 Key Version Number ('00' to use the default key set)
P2 '00'
Lc '08'
Data Host Challenge: Random number used in host and card cryptogram
generation
Le '00'

2.5.2 Initialize Update Response Message


The INITIALIZE UPDATE response message is specified in Table 2.8.

Table 2.8—Initialize Update Response Message


Field Length
KEYDATA (See Table 2.9) 10
Version number of the master key (KMC) 1
Identifier for Secure Channel Protocol 1
Sequence Counter 2
Card challenge (RCARD) 6
Card cryptogram 8

©2016 MasterCard – Proprietary and Confidential Page 17


M/Chip Advance Common Personalization Specification  August 2016
Implementation of EMV Card Personalization
Initialize Update

Table 2.9—Initial Content of Key Data

Field Length Format


Identifier of the KMC (e.g. IIN right justified and 6 BCD
left padded with 1111b per quartet)
Chip Serial Number (CSN) 4 Binary

2.5.3 Status Bytes


The status bytes that may be sent in response to the INITIALIZE UPDATE command
are listed in Table 2.10.

Table 2.10— Status Bytes for Initialize Update Command

SW12 Meaning
'9000' Successful command processing
'6A88' Referenced data not found

©2016 MasterCard – Proprietary and Confidential Page 18


M/Chip Advance Common Personalization Specification  August 2016
Implementation of EMV Card Personalization
External Authenticate

2.6 External Authenticate


The EXTERNAL AUTHENTICATE command follows the INITIALIZE UPDATE
command and is used to authenticate the personalization device to the card
application.
Refer to [EMV CPS] for complementary description of the EXTERNAL
AUTHENTICATE command.

2.6.1 External Authenticate Command Message


The EXTERNAL AUTHENTICATE command message is specified in Table 2.11.

Table 2.11—External Authenticate Command Message

Code Value
CLA '84'
INS '82'
P1 Security Level (see Table 2.12)
P2 '00'
Lc '10'
Data Host Cryptogram (8 bytes) || C-MAC (8 bytes)
Le Not present

The M/Chip Advance application must support the three security levels allowed in
EMV Card Personalization (coded in P1), described in Table 2.12.

Table 2.12—Security Levels Allowed by EMV Card Personalization


b8 b7 b6 b5 b4 b3 b2 b1 Description
0 0 0 0 0 0 1 1 Encryption and MAC
0 0 0 0 0 0 0 1 MAC
0 0 0 0 0 0 0 0 No Security

2.6.2 External Authenticate Response Message


There is no data field in the response message.

©2016 MasterCard – Proprietary and Confidential Page 19


M/Chip Advance Common Personalization Specification  August 2016
Implementation of EMV Card Personalization
External Authenticate

2.6.3 Status Bytes


The status bytes that may be sent in response to the EXTERNAL AUTHENTICATE
command are listed in Table 2.13.

Table 2.13— Status Bytes for External Authenticate

SW12 Meaning
'9000' Successful command processing
'6982' MAC failed verification
'6300' Authentication of host cryptogram failed
'6E00' CLA value not supported

©2016 MasterCard – Proprietary and Confidential Page 20


M/Chip Advance Common Personalization Specification  August 2016
Implementation of EMV Card Personalization
Store Data

2.7 Store Data


The STORE DATA command is used to personalize the M/Chip Advance application.
Refer to [EMV CPS] for complementary description of the STORE DATA command.

2.7.1 Store Data Command Message


The STORE DATA command message is specified in Table 2.14.

Table 2.14—Store Data Command Message

Code Value
CLA '80' - '84' (since the application supports the three security levels
defined in the EXTERNAL AUTHENTICATE, the application
supports both CLA = '80' and CLA = '84')
INS 'E2'
P1 Refer to Table 2.15
P2 P2 contains the block number coded sequentially from '00' to 'FF'.
Lc Length of data field
Data Refer to Table 2.16 and Table 2.17
Le Not present

Table 2.15 specifies the coding of P1.

Table 2.15—Reference Control Parameter P1

b8 b7 b6 b5 b4 b3 b2 b1 Description
x Last STORE DATA command Indicator
1: Last STORE DATA command
0: Not the last STORE DATA command
x x Encryption indicators:
00: No DGI is encrypted
01: Application dependent
10: RFU
11: All DGIs encrypted under SKUDEK
x x x x x RFU

The M/Chip Advance application must check the encryption indicators (P1[7 : 6]).
 If P1[7 : 6] = 00b (not encrypted), then the M/Chip Advance application
returns '6982' if the DGI is defined in chapter 5 as encrypted.
 If P1[7 : 6] = 11b (encrypted) then the M/Chip Advance application decrypts
the DGI and checks the validity of the decrypted data before storing the data.
If the decrypted data is not valid, the M/Chip Advance application returns
SW12 = '6982'.

©2016 MasterCard – Proprietary and Confidential Page 21


M/Chip Advance Common Personalization Specification  August 2016
Implementation of EMV Card Personalization
Store Data

 If P1[7 : 6] = 01b (application dependent), then the M/Chip Advance


application must check if the DGI is defined in chapter 5 as encrypted. If the
DGI is defined as encrypted, then the M/Chip Advance application decrypts
the DGI and checks the validity of the decrypted data before storing. If the
decrypted data is not valid, then the M/Chip Advance application returns
SW12 = '6982'. If the DGI is not defined as encrypted, then the M/Chip
Advance application stores the data in plaintext.
Depending on the security level set in the EXTERNAL AUTHENTICATE command,
the M/Chip Advance application:
 Does not verify a MAC and does not CBC-decrypt the STORE DATA value
field (EXTERNAL AUTHENTICATE P1= '00')
 Verifies the MAC (EXTERNAL AUTHENTICATE P1 = '01')
 CBC-decrypts the STORE DATA value field and verifies the MAC
(EXTERNAL AUTHENTICATE P1= '03')
The M/Chip Advance application must check the sequence of the STORE DATA
commands as indicated by the block number in P2. If the sequence is not respected,
then the application must reject the STORE DATA command and return
SW12 = '6A86'.
The M/Chip Advance application must support data grouping data spanning several
STORE DATA commands, as specified in [EMV CPS]. In this case, the M/Chip
Advance application must accept STORE DATA containing up to 255 bytes of data
(that is, Lc = 255). Data preparation may split any data grouping over several STORE
DATA commands.
The last STORE DATA command ends the personalization phase, irrespective of the
data groupings received by the M/Chip Advance application.
The STORE DATA command data coding is specified in Table 2.16 and Table 2.17.

Table 2.16—Command Data Coding

Field Content Length


DGI Identifier of data grouping to be stored 2
Length Length of data grouping 1 or 3
Data Plaintext/ciphered (SKUDEK) data grouping to be stored Var.
Grouping (possibly truncated at the maximum allowable length,
that is Lc equals 255 bytes including possible MAC and
encipherment padding in command wrapping)

©2016 MasterCard – Proprietary and Confidential Page 22


M/Chip Advance Common Personalization Specification  August 2016
Implementation of EMV Card Personalization
Store Data

Table 2.17—Command Data Coding (Subsequent Submission(s) for Long Data


Groupings) Field

Field Content Length


Data Plaintext/ciphered data grouping: Var.
Grouping Any remaining data grouping data (possibly again
(continued) truncated at the maximum allowable length, that is Lc
equals 255 bytes including possible MAC and
encipherment padding in command wrapping).

2.7.2 Store Data Response Message


There is no data field in the response message.

2.7.3 Status Bytes


The status bytes that may be sent in response to the STORE DATA command are
listed in Table 2.18.

Table 2.18—Store Data Response Message

SW12 Meaning
'9000' Successful command processing
'6700' Wrong data length
'6982' Security status not satisfied
'6985' Conditions of use not satisfied
'6A80' Incorrect values in command data
'6A84' Not enough memory space
'6A86' Incorrect P1 – P2
'6E00' CLA value not supported

©2016 MasterCard – Proprietary and Confidential Page 23


M/Chip Advance Common Personalization Specification  August 2016
Implementation of EMV Card Personalization
Data Groupings

2.8 Data Groupings


This section describes requirements related to the organization of the personalization
data in the data groupings.

2.8.1 Grouped Data Groupings


The M/Chip Advance application is not required to support several data groupings
grouped in a single STORE DATA.

2.8.2 Order of Data Groupings


As a minimum, the application must accept data groupings when provided in the order
specified by Table 6.2.

2.8.3 Version Control


When the M/Chip Advance application receives data groupings that are not
recognized (that is, the DGI is not supported by the application), the M/Chip Advance
application ignores them and processes the next data grouping. The response to the
STORE DATA is SW1-SW2 = '9000' and the M/Chip Advance application remains in
the state personalizing.

2.8.4 M/Chip Advance Data Groupings


The M/Chip Advance data groupings are described in detail in the following chapters:
 Chapter 3 describes data groupings corresponding to records in files.
 Chapter 5 defines the contents of the each DGI.
 Chapter 6 describes which data groupings are applicable to each M/Chip
Advance profile and its supported options.

2.8.5 Vendor Discretionary Data Groupings


The M/Chip Advance application implementations may require additional application-
specific personalization parameters to activate proprietary functionalities outside the
scope of this specification.
Vendor discretionary data groupings are optional, and strictly used to activate
proprietary functionalities. It must be possible to personalize an M/Chip Advance
application, fully functional and compliant with this specification document, without
vendor discretionary data groupings.
Vendor discretionary data groupings are allowed in the range of DGIs '5000' to
'5FFF'.

©2016 MasterCard – Proprietary and Confidential Page 24


M/Chip Advance Common Personalization Specification  August 2016
Implementation of EMV Card Personalization
Data Groupings

Furthermore, in order to enable personalization systems to prepare personalization


scripts that are compatible with several vendor implementations and avoid DGI
collisions between application providers, MasterCard allocates a subset of vendor
discretionary data groupings for each application vendor that requests it. The M/Chip
Advance application must ignore any unsupported (unrecognized) DGI.

©2016 MasterCard – Proprietary and Confidential Page 25


M/Chip Advance Common Personalization Specification  August 2016
Data Grouping Structures
Overview

3 Data Grouping Structures


3.1 Overview
This chapter explains the relationship between records and data groupings, and
specifies the structure of data groupings for data stored in files with an SFI between 1
and 30.

3.2 Data Groupings Reserved for Record Values


Some data groupings are reserved for record values. They are identified with DGIs in
the range 'XXYY' where:
后面xx='A0','B0' 的DGI
 '01' < = 'XX' < = '1E' and '01' ̄'1e'
01 ̄30    不是 Reserved for Record Values
 '01' < = 'YY' < = 'FF'
'XX' represents the SFI where the record is stored. 'YY' represents the record number.
Furthermore:
 '01' < = 'XX' < = '0A' represents files governed by EMV
 '0B' < = 'XX' < = '14' represents files governed by MasterCard
 '15' < = 'XX' < = '1E' represents files governed by the issuer 21 ̄30

Data preparation may split any of these data groupings over more than one STORE
DATA. MasterCard does not mandate the file and record structure for the
personalization of these files.
A record is always the value of a data grouping and is retrievable with the READ
RECORD command.
During personalization, the M/Chip Advance application receives a series of STORE
DATA commands corresponding to the record values and then stores the record
values in its allocated non-volatile memory. It must be possible to personalize
successfully the M/Chip Advance application by providing the DGIs for record values
in ascending order.
An issuer may request records with a record length of up to 247 bytes.
247+8=255

©2016 MasterCard – Proprietary and Confidential Page 26


M/Chip Advance Common Personalization Specification  August 2016
Data Grouping Structures
Files with SFI between 1 and 10

3.3 Files with SFI between 1 and 10


For EMV applications, the persistent data objects stored in files with an SFI between
1 to 10 are stored in records following the '70' template and are retrievable with the
EMV READ RECORD command.
The M/Chip Advance application, in both non-personalized and personalized states,
does not interpret the data objects stored in these records but instead interprets the
record itself (for example, for a personalized M/Chip Advance application, to build the
response message to the READ RECORD command).
There are ten files in which EMV records can be stored. Each file may contain up to
255 records. An issuer may request 3072 bytes of memory to store EMV records for
M/Chip Advance.
Although the minimum memory requirement for M/Chip Advance is 3072 bytes for
EMV files, different M/Chip Advance derived products may have lesser amounts.
The EMV file memory requirements for the different M/Chip Advance products are
given in Table 3.1.

Table 3.1—EMV File Memory Requirements

M/Chip Advance Product EMV File Memory Requirement


Payment & Data Storage 3072 bytes
Payment with RSA 3072 bytes
Payment without RSA 2560 bytes
Contact only with RSA 2048 bytes
Contact only without RSA 1536 bytes
Contactless only 2048 bytes

3.4 Files with SFI between 11 and 20


Some data groupings are reserved for MasterCard records. These data groupings are
identified with DGIs with a value of 'XXYY', where:
 'XX' > = '0B'
'xx'='0E',即SFI=14时,用于DS记录
 'XX < = '14' ##record data --store   slots     tag DF01, tag DF02, tag DF03, tag DF04, tag DF05, tag DF06

Among those DGIs, 'XX' = '0E' is defined for M/Chip Advance applications. These
DGIs are used for IDS (SFI = 14).
Depending on the M/Chip Advance profile, IDS DGIs may or may not need to be
personalized (Personalization is required when initial applicative data has to be stored
as part of the card profile).
M/Chip Advance applications do not have to support DGIs for records in other files
with an SFI between 11 and 20.

©2016 MasterCard – Proprietary and Confidential Page 27


M/Chip Advance Common Personalization Specification  August 2016
Data Grouping Structures
Files with SFI between 21 and 30

If IDS records are to be personalized, the following structure is used.

Table 3.2—Data Storage Record Structure

T L V
'E5' var. up to 205 T L V
'DF01' 8 Operator Identifier
'DF02' 1 Digest Status
'DF03' 8 Digest
'DF04' 1 Slot Management Control
'DF05' 8 Summary
'DF06' var. up to 160 Operator Data Set Card

The M/Chip Advance implementation must support the following requirements:


 There shall be at least 208 bytes of storage for each IDS record (known as a
slot).
 The Data Storage File (SFI 14) shall contain records for at least 5 data slots (at
least 1040 bytes). It is left to the implementation to extend the number of
records in the Data Storage File.
 The number of records in the Data Storage File is stored in an internal data
object called DS Number Of Slots.

3.5 Files with SFI between 21 and 30


Some data groupings are reserved for Issuer record values. These data groupings are
identified with DGIs with a value of 'XXYY', where:
 'XX' > = '15'
 'XX' < = '1E'
M/Chip Advance applications do not have to support these DGI values.

3.6 Dynamic Allocation of Record Memory


M/Chip Advance application shall support dynamic allocation of record memory
during the personalization, when the corresponding STORE DATA is received.

©2016 MasterCard – Proprietary and Confidential Page 28


M/Chip Advance Common Personalization Specification  August 2016
RSA Key Format and Data Grouping Encryption
Key Format

4 RSA Key Format and Data Grouping


Encryption
4.1 Key Format
The secret key is personalized by its CRT components. According to RSA,
S = md mod n, where m is the data to be signed or decrypted, n is the card key
modulus and d is the card private key exponent. The modulus, n, is created as the
product of two prime numbers, p and q. Table 4.1 provides the cross reference
between the mathematical names and the data.

Table 4.1—Cross Reference between Mathematical Variable and Data Object

Name Given in This Document Variable


CRT constant q-1 mod p q-1 mod p
CRT constant d mod (q-1) d mod (q-1)
CRT constant d mod (p-1) d mod (p-1)
CRT constant prime factor q q
CRT constant prime factor p p

4.2 Encrypted Data Groupings


Some data groupings described in the following sections contain data that is always
ECB-encrypted. The other data groupings may not be ECB-encrypted. Refer to
[EMV CPS] for a definition of encryption using ECB mode.
With the exception of the DES keys and the PIN Block, all encrypted data must be
padded. Refer to [EMV CPS] for a definition of the padding rules.

©2016 MasterCard – Proprietary and Confidential Page 29


M/Chip Advance Common Personalization Specification  August 2016
DGI Definitions
DGI '0E01' to '0EFF' – Data Storage Records

5 DGI Definitions
5.1 DGI '0E01' to '0EFF' – Data Storage Records
record data --store  slots 
Encryption is not required. tag DF01, tag DF02, tag DF03, tag DF04, tag DF05, tag DF06
This DGI is present if IDS is used and the issuer wants to personalize an initial value
in one or more data storage records.

Data Object Offset Length


Data Storage record x (x = 1..5 or more) 0 208

5.2 DGI '8000' – Contact Keyset


DGI '8000' is encrypted with SKUDEK as defined in [EMV CPS]. No padding is
applicable.

Data Object Offset Length


AC Master Key (Contact) 0 16
SMI Master Key (Contact) 16 16
SMC Master Key (Contact) 32 16

5.3 DGI '8001' – Contactless Keyset


DGI '8001' is encrypted with SKUDEK as defined in [EMV CPS]. No padding is
applicable.

Data Object Offset Length


AC Master Key (Contactless) 0 16
SMI Master Key (Contactless) 16 16
SMC Master Key (Contactless) 32 16

©2016 MasterCard – Proprietary and Confidential Page 30


M/Chip Advance Common Personalization Specification  August 2016
DGI Definitions
DGI '8004' – AC Master Key (MAS4C)

5.4 DGI '8004' – AC Master Key (MAS4C)


DGI '8004' is encrypted with SKUDEK as defined in [EMV CPS]. No padding is
applicable.

Data Object Offset Length


AC Master Key (MAS4C) 0 16

5.5 DGI '8010' – Reference PIN Block 指的是8字节PIN后面不需要填充8000000000000000

DGI '8010' is encrypted with SKUDEK. No padding is applicable.

Data Object Offset Length


Reference PIN (in Format 1) 0 8

The Reference PIN (in Format 1) data object follows ISO 9564-1 format 1. This
format is not the EMV format used by the M/Chip Advance application when
personalized.
During personalization, the M/Chip Advance application converts the Reference PIN
in Format 1 into the Reference PIN in EMV format before storing it in permanent
memory.

5.6 DGI '8201' – ICC Private Key CRT constant q-1


mod p
DGI '8201' is encrypted with SKUDEK. It is padded with a byte '80', followed by 0-7
bytes of '00' to obtain a multiple of 8 bytes.
The q-1 mod p is the default convention to be used to generate the values for DGIs
containing the CRT components for the M/Chip Advance application (see
[EMV CPS]).
As a minimum, the M/Chip Advance application must accept any RSA key with
modulus length in the range 96 to 176 bytes, for both CDA and PIN verification. RSA
keys storage and RSA computations use the CRT.

Data Object Offset Length


ICC Private Key CRT constant q-1 mod p 0 Var., 8-byte
multiple

©2016 MasterCard – Proprietary and Confidential Page 31


M/Chip Advance Common Personalization Specification  August 2016
DGI Definitions
DGI '8202' – ICC Private Key CRT constant d mod (q - 1)

5.7 DGI '8202' – ICC Private Key CRT constant d mod


(q - 1)
DGI '8202' is encrypted with SKUDEK. It is padded with a byte '80', followed by 0-7
bytes of '00' to obtain a multiple of 8 bytes.
The q-1 mod p is the default convention to be used to generate the values for DGIs
containing the CRT components for the M/Chip Advance application (see
[EMV CPS]).

Data Object Offset Length


ICC Private Key CRT constant d mod (q – 1) 0 Var., 8-byte
multiple

5.8 DGI '8203' – ICC Private Key CRT constant d mod


(p - 1)
DGI '8203' is encrypted with SKUDEK. It is padded with a byte '80', followed by 0-7
bytes of '00' to obtain a multiple of 8 bytes.
The q-1 mod p is the default convention to be used to generate the values for DGIs
containing the CRT components for the M/Chip Advance application (see
[EMV CPS]).

Data Object Offset Length


ICC Private Key CRT constant d mod (p – 1) 0 Var., 8-byte
multiple

5.9 DGI '8204' – ICC Private Key CRT constant prime


factor q
DGI '8204' is encrypted with SKUDEK. It is padded with a byte '80', followed by 0-7
bytes of '00' to obtain a multiple of 8 bytes.
The q-1 mod p is the default convention to be used to generate the values for DGIs
containing the CRT components for the M/Chip Advance application (see
[EMV CPS]).

Data Object Offset Length


ICC Private Key CRT constant prime factor q 0 Var., 8-byte
multiple

©2016 MasterCard – Proprietary and Confidential Page 32


M/Chip Advance Common Personalization Specification  August 2016
DGI Definitions
DGI '8205' – ICC Private Key CRT constant prime factor p

5.10 DGI '8205' – ICC Private Key CRT constant prime


factor p
DGI '8205' is encrypted with SKUDEK. It is padded with a byte '80', followed by 0-7
bytes of '00' to obtain a multiple of 8 bytes.
The q-1 mod p is the default convention to be used to generate the values for DGIs
containing the CRT components for the M/Chip Advance application (see
[EMV CPS]).

Data Object Offset Length


ICC Private Key CRT constant prime factor p 0 Var., 8-byte
multiple

5.11 DGI '8301' – ICC PIN Encipherment Private Key


CRT constant q-1 mod p
DGI '8301' is encrypted with SKUDEK. It is padded with a byte '80', followed by 0-7
bytes of '00' to obtain a multiple of 8 bytes.
The q-1 mod p is the default convention to be used to generate the values for DGIs
containing the CRT components for the M/Chip Advance application (see
[EMV CPS]).
As a minimum, the M/Chip Advance application must accept any RSA key with
modulus length in the range 96 to 176 bytes, for both CDA and PIN verification. RSA
keys storage and RSA computations use the CRT.

Data Object Offset Length


ICC PIN Encipherment Private Key CRT constant q-1 0 Var., 8-byte
mod p multiple

©2016 MasterCard – Proprietary and Confidential Page 33


M/Chip Advance Common Personalization Specification  August 2016
DGI Definitions
DGI '8302' – ICC PIN Encipherment Private Key CRT constant d mod (q - 1)

5.12 DGI '8302' – ICC PIN Encipherment Private Key


CRT constant d mod (q - 1)
DGI '8302' is encrypted with SKUDEK. It is padded with a byte '80', followed by 0-7
bytes of '00' to obtain a multiple of 8 bytes.
The q-1 mod p is the default convention to be used to generate the values for DGIs
containing the CRT components for the M/Chip Advance application (see
[EMV CPS]).

Data Object Offset Length


ICC PIN Encipherment Private Key CRT constant d mod 0 Var., 8-byte
(q – 1) multiple

5.13 DGI '8303' – ICC PIN Encipherment Private Key


CRT constant d mod (p - 1)
DGI '8303' is encrypted with SKUDEK. It is padded with a byte '80', followed by 0-7
bytes of '00' to obtain a multiple of 8 bytes.
The q-1 mod p is the default convention to be used to generate the values for DGIs
containing the CRT components for the M/Chip Advance application (see
[EMV CPS]).

Data Object Offset Length


ICC PIN Encipherment Private Key CRT constant d 0 Var., 8-byte
mod(p – 1) multiple

5.14 DGI '8304' – ICC PIN Encipherment Private Key


CRT constant prime factor q
DGI '8304' is encrypted with SKUDEK. It is padded with a byte '80', followed by 0-7
bytes of '00' to obtain a multiple of 8 bytes.
The q-1 mod p is the default convention to be used to generate the values for DGIs
containing the CRT components for the M/Chip Advance application (see
[EMV CPS]).

Data Object Offset Length


ICC PIN Encipherment Private Key CRT constant prime 0 Var., 8-byte
factor q multiple

©2016 MasterCard – Proprietary and Confidential Page 34


M/Chip Advance Common Personalization Specification  August 2016
DGI Definitions
DGI '8305' – ICC PIN Encipherment Private Key CRT constant prime factor p

5.15 DGI '8305' – ICC PIN Encipherment Private Key


CRT constant prime factor p
DGI '8305' is encrypted with SKUDEK. It is padded with a byte '80', followed by 0-7
bytes of '00' to obtain a multiple of 8 bytes.
The q-1 mod p is the default convention to be used to generate the values for DGIs
containing the CRT components for the M/Chip Advance application (see
[EMV CPS]).

Data Object Offset Length


ICC PIN Encipherment Private Key CRT constant prime 0 Var., 8-byte
factor p multiple

5.16 DGI '8400' – Contact KDCVC3


DGI '8400' is encrypted with SKUDEK as defined in [EMV CPS]. No padding is
applicable

Data Object Offset Length


KDCVC3 (Contact) 0 16

5.17 DGI '8401' – Contactless KDCVC3


DGI '8401' is encrypted with SKUDEK as defined in [EMV CPS]. No padding is
applicable.

Data Object Offset Length


KDCVC3 (Contactless) 0 16

IVCVC3  - Initialization Vector for CVC3 generation
KDCVC3  - ICC Derived Key for CVC3 generation

©2016 MasterCard – Proprietary and Confidential Page 35


M/Chip Advance Common Personalization Specification  August 2016
DGI Definitions
DGI '9102' – SELECT Response Data – FCI Proprietary Template

5.18 DGI '9102' – SELECT Response Data – FCI


Proprietary Template 响应FCI信息的6F模板的内容:
84TAG值域是应用AID 和
A5模板 
Encryption is not required.
The File Control Information Proprietary Template is TLV-encoded. Only the File
Control Information Proprietary Template is personalized, not the complete File
Control Information. That is, the value starts with 'A5' (refer to [EMV CPS]).

Data Object Offset Length


File Control Information Proprietary Template 0 var

5.19 DGI '9010' – PIN Related Data


Encryption is not required.

Data Object Offset Length


PIN Try Counter 0 1
PIN Try Limit 1 1

5.20 DGI 'A002' – Common Risk Management


针对接触的是A012
Parameters 没有T和L,只有一串V 针对非接触的是A022

Encryption is not required.

Data Object Offset Length


Accumulator 1 Currency Code 0 2
Accumulator 1 Currency Conversion Table 2 25
Accumulator 1 Lower Limit 27 6
Accumulator 1 Upper Limit 33 6
Accumulator 2 Currency Code 39 2
Accumulator 2 Currency Conversion Table 41 25
Accumulator 2 Lower Limit 66 6
Accumulator 2 Upper Limit 72 6
Additional Check Table 78 18
CDOL1 Related Data Length 96 1
Counter 1 Lower Limit 97 1
Counter 1 Upper Limit 98 1

©2016 MasterCard – Proprietary and Confidential Page 36


M/Chip Advance Common Personalization Specification  August 2016
DGI Definitions
DGI 'A004' – Public Key Length

Data Object Offset Length


Counter 2 Lower Limit 99 1
Counter 2 Upper Limit 100 1
CRM Country Code 101 2
Cryptogram Version Number V2.x 103 1
Default ARPC Response Code 104 2
Interface Enabling Switch 106 1
MTA Currency Code 107 2
Number Of Days Off Line Limit 109 2

5.21 DGI 'A004' – Public Key Length


Encryption is not required.

Data Object Offset Length


Length Of ICC Public Key Modulus 0 1
Length Of ICC PIN Encipherment Public Key Modulus 1 1

5.22 DGI 'A005' – Contact Get Processing Options


Response
Encryption is not required.

Data Object Offset Length


Application Interchange Profile (Contact) 0 2
Application File Locator (Contact) 2 Var.

The length of the Application File Locator (Contact) varies according to the
organization of data objects in records. All M/Chip Advance implementations support
at least up to 32 bytes. Some implementations may support more than 32 bytes.
Only values of the Application Interchange Profile (Contact) and the Application File
Locator (Contact) are personalized, without TLV-coding.

©2016 MasterCard – Proprietary and Confidential Page 37


M/Chip Advance Common Personalization Specification  August 2016
DGI Definitions
DGI 'A006' – Contact ICC Dynamic Number Master Key

5.23 DGI 'A006' – Contact ICC Dynamic Number


Master Key
DGI 'A006' is encrypted with SKUDEK as defined in [EMV CPS]. No padding is
applicable.

Data Object Offset Length


ICC Dynamic Number Master Key (Contact) 0 16

5.24 DGI 'A007' – Application Status and ATC Limit


Encryption is not required.

Data Object Offset Length


Application Transaction Counter Limit 0 2
Previous Transaction History 2 1

5.25 DGI 'A008' – PIN Decipherments Error Counter


Limit
Encryption is not required.

Data Object Offset Length


PIN Decipherments Error Counter Limit 0 2

5.26 DGI 'A009' – Application Life Cycle Data


Encryption is not required.

Data Object Offset Length


Application Life Cycle Data – Application Issuer ID 0 20

©2016 MasterCard – Proprietary and Confidential Page 38


M/Chip Advance Common Personalization Specification  August 2016
DGI Definitions
DGI 'A00A' – Last Online Transaction Date

5.27 DGI 'A00A' – Last Online Transaction Date


Encryption is not required.

Data Object Offset Length


Last Online Transaction Date 0 2

5.28 DGI 'A00E' – Data Storage Configuration


Encryption is not required.

Data Object Offset Length


DS management Control 0 1
DS Number Of Slots 1 1
DSPK 2 12

5.29 DGI 'A012' – Contact Risk Management


Parameters 非接触是A022
Encryption is not required.

Data Object Offset Length


Accumulator 1 Control (Contact) 0 1
Accumulator 1 CVR Dependency Data (Contact) 1 3
Accumulator 2 Control (Contact) 4 1
Accumulator 2 CVR Dependency Data (Contact) 5 3
Counter 1 Control (Contact) 8 1
Counter 1 CVR Dependency Data (Contact) 9 3
Counter 2 Control (Contact) 12 1
Counter 2 CVR Dependency Data (Contact) 13 3
CVR Issuer Discretionary Data (Contact) 16 1
Interface Identifier (Contact) 17 1
MTA CVM (Contact) 18 6
MTA NoCVM (Contact) 24 6

©2016 MasterCard – Proprietary and Confidential Page 39


M/Chip Advance Common Personalization Specification  August 2016
DGI Definitions
DGI 'A013' – Application Control (Contact)

5.30 DGI 'A013' – Application Control (Contact)


Encryption is not required.

Data Object Offset Length


Application Control (Contact) 0 6

5.31 DGI 'A014' – Read Record Filter (Contact)


Read Record Filter (Contact) Read Record Filter (Contactless)
Encryption is not required. Tag:      'DF40'
Tag:      'DF3F'

Data Object Offset Length


Read Record Filter (Contact) 0 Var.

5.32 DGI 'A015' – Card Issuer Action Codes (Contact) CIAC

Encryption is not required.

Data Object Offset Length


Card Issuer Action Code (Contact) – Decline 0 3
Card Issuer Action Code (Contact) – Default 3 3
Card Issuer Action Code (Contact) – Online 6 3

5.33 DGI 'A016' – Contactless ICC Dynamic Number


Master Key
DGI 'A016' is encrypted with SKUDEK as defined in [EMV CPS]. No padding is
applicable.

Data Object Offset Length


ICC Dynamic Number Master Key (Contactless) 0 16

©2016 MasterCard – Proprietary and Confidential Page 40


M/Chip Advance Common Personalization Specification  August 2016
DGI Definitions
DGI 'A017' – Contact 3DES Key Information

5.34 DGI 'A017' – Contact 3DES Key Information


Encryption is not required.

Data Object Offset Length


AC Session Key Counter Limit (Contact) 0 2
Key Derivation Index (Contact) 2 1
SMI Session Key Counter Limit (Contact) 3 2

5.35 DGI 'A022' – Contactless Risk Management


Parameters
Encryption is not required.

Data Object Offset Length


Accumulator 1 Control (Contactless) 0 1
Accumulator 1 CVR Dependency Data (Contactless) 1 3
Accumulator 2 Control (Contactless) 4 1
Accumulator 2 CVR Dependency Data (Contactless) 5 3
Counter 1 Control (Contactless) 8 1
Counter 1 CVR Dependency Data (Contactless) 9 3
Counter 2 Control (Contactless) 12 1
Counter 2 CVR Dependency Data (Contactless) 13 3
CVR Issuer Discretionary Data (Contactless) 16 1
Interface Identifier (Contactless) 17 1
MTA CVM (Contactless) 18 6
MTA NoCVM (Contactless) 24 6

5.36 DGI 'A023' – Application Control (Contactless)


Encryption is not required.

Data Object Offset Length


Application Control (Contactless) 0 6

©2016 MasterCard – Proprietary and Confidential Page 41


M/Chip Advance Common Personalization Specification  August 2016
DGI Definitions
DGI 'A024' – Read Record Filter (Contactless)

5.37 DGI 'A024' – Read Record Filter (Contactless)


Encryption is not required.

Data Object Offset Length


Read Record Filter (Contactless) 0 Var.

5.38 DGI 'A025' – Card Issuer Action Codes


(Contactless)
Encryption is not required.

Data Object Offset Length


Card Issuer Action Code (Contactless) – Decline 0 3
Card Issuer Action Code (Contactless) – Default 3 3
Card Issuer Action Code (Contactless) – Online 6 3

5.39 DGI 'A027' – Contactless 3DES Key Information


Encryption is not required.

Data Object Offset Length


AC Session Key Counter Limit (Contactless) 0 2
Key Derivation Index (Contactless) 2 1
SMI Session Key Counter Limit (Contactless) 3 2

5.40 DGI 'A028' – MAS4C 3DES Key Information


Encryption is not required.

Data Object Offset Length


AC Session Key Counter Limit (MAS4C) 0 2
Key Derivation Index (MAS4C) 2 1

©2016 MasterCard – Proprietary and Confidential Page 42


M/Chip Advance Common Personalization Specification  August 2016
DGI Definitions
DGI 'B002' – Log Configuration

5.41 DGI 'B002' – Log Configuration


Encryption is not required.

Data Object Offset Length


Log Data Table 0 9
Log Format 9 Var.

5.42 DGI 'B005' – Contactless Get Processing Options


Response
Encryption is not required.

Data Object Offset Length


Application Interchange Profile (Contactless) 0 2
Application File Locator (Contactless) 2 Var.

The length of the Application File Locator (Contactless) varies according to the
organization of data objects in records. All M/Chip Advance implementations support
at least up to 32 bytes. Some implementations may support more than 32 bytes.
Only values of the Application Interchange Profile (Contactless) and the Application
File Locator (Contactless) are personalized, without TLV-coding.

5.43 DGI 'B010' – Contact IVCVC3


Encryption is not required.

Data Object Offset Length


IVCVC3(Track1) (Contact) 0 2
IVCVC3(Track2) (Contact) 2 2

©2016 MasterCard – Proprietary and Confidential Page 43


M/Chip Advance Common Personalization Specification  August 2016
DGI Definitions
DGI 'B011' to 'B015' – Protected Data Envelopes

5.44 DGI 'B011' to 'B015' – Protected Data Envelopes


Encryption is not required.
This DGI is present if the issuer wants to personalize an initial value in the Data
Storage Envelopes.

Data Object Offset Length


Protected Data Envelope x (x = 1 to 5) 0 Var.

5.45 DGI 'B016' to 'B01A' – Unprotected Data


Envelopes
Encryption is not required.
This DGI is present if the issuer wants to personalize an initial value in the Data
Storage Envelopes.

Data Object Offset Length


Unprotected Data Envelope x (x = 1 to 5) 0 Var.

5.46 DGI 'B023'– Contactless IVCVC3


Encryption is not required.

Data Object Offset Length


IVCVC3(Track1) (Contactless) 0 2
IVCVC3(Track2) (Contactless) 2 2

©2016 MasterCard – Proprietary and Confidential Page 44


M/Chip Advance Common Personalization Specification  August 2016
DGI Definitions
DGI 'B100' – Contact Relay Resistance Protocol Parameters

5.47 DGI 'B100' – Contact Relay Resistance Protocol


Parameters
Encryption is not required.

Data Object Offset Length


Min Time For Processing Relay Resistance APDU 0 2
(Contact)
Max Time For Processing Relay Resistance APDU 2 2
(Contact)
Transmission Time For Relay Resistance R-APDU 4 2
(Contact)

5.48 DGI 'B101' – Contactless Relay Resistance


Protocol Parameters
Encryption is not required.

Data Object Offset Length


Min Time For Processing Relay Resistance APDU 0 2
(Contactless)
Max Time For Processing Relay Resistance APDU 2 2
(Contactless)
Transmission Time For Relay Resistance R-APDU 4 2
(Contactless)

5.49 DGI 'B102' – Linked Application Index


Encryption is not required.

Data Object Offset Length


Linked Application Index 0 1

©2016 MasterCard – Proprietary and Confidential Page 45


M/Chip Advance Common Personalization Specification  August 2016
Profile Data Groupings
Conditional Data Groupings

6 Profile Data Groupings


6.1 Conditional Data Groupings
Some data groupings described in this chapter are conditional. Table 6.1 shows the
notation used to represent each condition and gives descriptions of the conditions.

Table 6.1—Explanation of Data Grouping Conditions

Condition Description
CCC If the COMPUTE CRYPTOGRAPHIC CHECKSUM command
is used.
CLESS If contactless interface is used.
CT If contact interface is used.
LINKAPP If the Linked Application Index is used to address target
applications by the linked application mechanism
LOG If transaction logging is used.
LOTD If last online transaction date is used.
MAS4C If dedicated MAS4C key is used
PINENC If offline PIN encipherment is used
PINKEY If a dedicated key for offline PIN encipherment is used.
RRP If Relay Resistance Protocol is used
xDA If DDA or CDA function is used

©2016 MasterCard – Proprietary and Confidential Page 46


M/Chip Advance Common Personalization Specification  August 2016
Profile Data Groupings
Data Grouping for Each M/Chip Advance Product

6.2 Data Grouping for Each M/Chip Advance Product


Table 6.2 defines which data groupings are to be used for each of the M/Chip Advance
products;
 MCADS M/Chip Advance Payment & Data Storage
 MCAP M/Chip Advance Payment
 MCADP-C M/Chip Advance Derived Product - Contact Only
 MCADP-CL M/Chip Advance Derived Product - Contactless Only
Presence of a DGI is indicated as follows:
 M: Mandatory
 C: Conditional (condition defined in column "Condition" in accordance to the
code described in Table 6.1)
 O: Optional. It is up to the issuer to define a value for the data object in the
DGI
 N/A: Not applicable (DGI not used for this product)
Note that where more than one conditional term is used, operators AND or OR
describe the condition that applies.
It must be possible to personalize successfully the M/Chip Advance application by
providing the DGIs in the order and with the presence conditions featured in
Table 6.2. Other personalization orders are possible, but outside of the scope of this
specification.
In terms of the lifecycle of the card, card personalization takes place after pre-
personalization and prior to card issuance. The M/Chip Advanced application must be
installed and initialized before the personalization of the DGIs starts. Additional post
personalization steps must not be required after completion of the personalization.

©2016 MasterCard – Proprietary and Confidential Page 47


M/Chip Advance Common Personalization Specification  August 2016
Profile Data Groupings
Data Grouping for Each M/Chip Advance Product

Table 6.2—Data Groupings for Each Product

DGI MCADS MCAP MCADP-C MCADP-CL

Condition

Condition

Condition

Condition
Presence

Presence

Presence

Presence
(if C)

(if C)

(if C)

(if C)
'9102' M M M M
'A005' C [CT] C [CT] M N/A
'B005' C [CLESS] C [CLESS] N/A M
'A002' M M M M
'A00A' C [LOTD] C [LOTD] C [LOTD] C [LOTD]
'A007' M M M M
'A009' M M M M
'A012' C [CT] C [CT] M N/A
'A013' C [CT] C [CT] M N/A
'A014' C [CT] C [CT] M N/A
'A015' C [CT] C [CT] M N/A
'A022' C [CLESS] C [CLESS] N/A M
'A023' C [CLESS] C [CLESS] N/A M
'A024' C [CLESS] C [CLESS] N/A M
'A025' C [CLESS] C [CLESS] N/A M
'8000' C [CT] C [CT] M N/A
'8001' C [CLESS] C [CLESS] N/A M

©2016 MasterCard – Proprietary and Confidential Page 48


M/Chip Advance Common Personalization Specification  August 2016
Profile Data Groupings
Data Grouping for Each M/Chip Advance Product

DGI MCADS MCAP MCADP-C MCADP-CL

Condition

Condition

Condition

Condition
Presence

Presence

Presence

Presence
(if C)

(if C)

(if C)

(if C)
'9010' M M M M
'8010' M M M M
'A004' C [xDA] OR [PINKEY] C [xDA] OR [PINKEY] C [xDA] OR [PINKEY] C [xDA] OR [PINKEY]
'8201' C [xDA] C [xDA] C [xDA] C [xDA]
'8202' C [xDA] C [xDA] C [xDA] C [xDA]
'8203' C [xDA] C [xDA] C [xDA] C [xDA]
'8204' C [xDA] C [xDA] C [xDA] C [xDA]
'8205' C [xDA] C [xDA] C [xDA] C [xDA]
'8301' C [PINKEY] C [PINKEY] C [PINKEY] C [PINKEY]
'8302' C [PINKEY] C [PINKEY] C [PINKEY] C [PINKEY]
'8303' C [PINKEY] C [PINKEY] C [PINKEY] C [PINKEY]
'8304' C [PINKEY] C [PINKEY] C [PINKEY] C [PINKEY]
'8305' C [PINKEY] C [PINKEY] C [PINKEY] C [PINKEY]
'A008' C [PINENC] C [PINENC] C [PINENC] C [PINENC]
'8400' C [CCC] AND [CT] C [CCC] AND [CT] C [CCC] N/A
'8401' C [CCC] AND [CLESS] C [CCC] AND [CLESS] N/A C [CCC]
'B010' C [CCC] AND [CT] C [CCC] AND [CT] C [CCC] N/A
'B023' C [CCC] AND [CLESS] C [CCC] AND [CLESS] N/A C [CCC]

©2016 MasterCard – Proprietary and Confidential Page 49


M/Chip Advance Common Personalization Specification  August 2016
Profile Data Groupings
Data Grouping for Each M/Chip Advance Product

DGI MCADS MCAP MCADP-C MCADP-CL

Condition

Condition

Condition

Condition
Presence

Presence

Presence

Presence
(if C)

(if C)

(if C)

(if C)
'A006' C [CT] C [CT] M N/A
'A016' C [CLESS] C [CLESS] N/A M
'A017' C [CT] C [CT] M N/A
'A027' C [CLESS] C [CLESS] N/A M
'A028' C [MAS4C] C [MAS4C] C [MAS4C] C [MAS4C]
'8004' C [MAS4C] C [MAS4C] C [MAS4C] C [MAS4C]
'B002' C [LOG] C [LOG] C [LOG] C [LOG]
'B100' C [RRP] AND [CT] C [RRP] AND [CT] C [RRP] N/A
'B101' C [RRP] AND [CLESS] C [RRP] AND [CLESS] N/A C [RRP]
'B102' C [LINKAPP] C [LINKAPP] C [LINKAPP] C [LINKAPP]
'A00E' M N/A N/A N/A
'B011' to O N/A N/A N/A
'B015'
'B016' to O N/A N/A N/A
'B01A'
'0E01' to O N/A N/A N/A
'0EFF'

©2016 MasterCard – Proprietary and Confidential Page 50


M/Chip Advance Common Personalization Specification  August 2016
Profile Data Groupings
Data Grouping for Each M/Chip Advance Product

DGI MCADS MCAP MCADP-C MCADP-CL

Condition

Condition

Condition

Condition
Presence

Presence

Presence

Presence
(if C)

(if C)

(if C)

(if C)
'WXYZ'1 O O O O
'5XYZ'2 O O O O

1
Data groupings for record values. The order of the DGIs 0101 ... 1E1F must be in ascending order.
2
Vendor discretionary data groupings

©2016 MasterCard – Proprietary and Confidential Page 51


M/Chip Advance Common Personalization Specification  August 2016
*** END OF DOCUMENT ***

©2016 MasterCard – Proprietary and Confidential Page 52


M/Chip Advance Common Personalization Specification  August 2016

You might also like