1 Q extended data needs to be written into Three DGI: a001, 8020,9020
1.1 a001 extended application configuration
DGI |
Length |
Value (example) |
A001 |
7 * n |
15 01 00 00 ff 00 00 Data is organized in 7 bytes as a unit. Each unit corresponds to the configuration information of an extended application file. The parsing is as follows: 1-byte extended application file SFI; 1-byte file type: 01 indicates a variable-length record file, 02 indicates the cyclic record file; 1-byte read permission: 00 indicates read using the read CAPP cache command 1-byte write permission: 00 indicates update using the update CAPP cache command 1-byte maximum length of a single record: Limit the maximum length of records that can be used 2-byte file size configuration: for variable-length record files, 2 bytes indicates the default file size, 00 indicates the size is not limited; for cyclic record files, it is the number of 1-byte records and the size of 1-byte records. You can adjust the DGI data domains based on the actual number of application files to be used and the actual SFI. The number and order of units consisting of 7 bytes determine the number and order of keys activated in the subsequent 8020 data domains. They must correspond one to one. |
1.2 8020 subkey activation for extended applications
The composition and sequence of DGI data are as follows. The key sequence matches the SFI sequence of files defined in a001 and is set as the activation key of each file.
DGI |
Len |
Value |
8020 |
10 * n |
0x13 file extension application enable protection key (16 bytes) 0x14 file extension application enable protection key (16 bytes) .......... |
1.3 9020: key verification value enabled for extended applications
DGI data is composed of the following data. The Checksum value (kcv) is composed of 8 bytes of each key pair in 8020 and 3 bytes left after encryption. The Checksum key order must be the same as that in 8020.
DGI |
Len |
Value |
9020 |
03 * n |
0x13 file Compound Application enable protection key verification value (3 bytes) 0x14 file Compound Application enable protection key verification value (3 bytes) ....... |
2 append record: add industry application records
Cpureset () 00a4040008a00000033301010180ca9f3605 (ATC + 9000) ATc = copy (ATC) ATc = 000000000000 + atccappk1 = encrypt // application activation key cappk2 = encrypt // record modification key // write 0x16 into file record B0: 10110 000ecb_3des_en (cappk2, cappk1, key2) HMD = 04e200a81e + key2 + 057007 + String (8000000000) // tlv3des_mac (ATC + HMD +, cappk1, Mac) HMD + Mac // write 0x1e cyclic file record ecb_3des_en (cappk2, cappk1, key2) HMD = 04e200f01e + key2 + 057007 + String (8000000000) 3des_mac (ATC + HMD +, cappk1, Mac) for details about HMD + Mac, see the new record (record APPEND Command) in specification 14 A.3)
3 (read extended application data) command datacapp read
Cpureset () 00a4040008a00000033301010180b400a8020570 // read 0x15 and convert it into a file. The 0570 record 00b201f400 // read the 0x1e circular file, the first record
4. segment deduction transaction process
4.1 df60 = 01
2> application initialization (required): <commad 00a4040008a000000333010101/>
4.2 df60 = 01, rmac read
</PRE> <PRE code_snippet_id = "491671" snippet_file_name = "blog_20151121_2_5217923" name = "code" class = "CPP"> 2.1> Read cappdata: √ CARDS support both fee deduction and offline pre-authorization <commad 80b400b00a05701234567812345678/> <return 0570070000000000000000001c895f11 (4-byte rmac)/>
4.3 Flowchart
5 offline pre-authorized transactions
Indicates to select or execute offline pre-authorized transactions. The value 02 of df60 indicates to select or execute offline pre-authorized transactions. The value 03 of df60 indicates to complete transactions. For the flowchart, see section 13. Offline pre-authorized transactions.
Text/Xin Xinyuan Chong Reprinted please indicate the source http://blog.csdn.net/yxstars/article/details/40350311
Qpboc extended personalization and transaction process