我正在尝试为Mastercard非接触式卡构造一个generate AC命令。我相信我已经正确地从CDOL1读取了该卡所需的信息,并在Generate AC命令中以正确的长度发送了它,但是正确的长度是6700 (错误的长度命令)。任何关于问题所在的建议都将不胜感激。
该卡提供的CDOL1为:
8C | len:27 Card Risk Management Data Object List 1 (CDOL1)
9F02 | len:06 Amount, Authorised (Numeric)
9F03 | len:06 Amount, Other (Numeric)
9F1A | len:02 Terminal Country Code
95 | len:05 Terminal Verification Results
5F2A | len:02 Transaction Currency Code
9A | len:03 Transaction Date
9C | len:01 Transaction Type
9F37 | len:04 Unpredictable Number
9F35 | len:01 Terminal Type
9F45 | len:02 Data Authentication Code
9F4C | len:08 ICC Dynamic Number
9F34 | len:03 Cardholder Verification Method (CVM) Results
9F21 | len:03 Transaction Time HHMMSS
9F7C | len:14 Customer Exclusive Data (CED)我为它提供了值
Amount, Authorised (Numeric) 000000000100
Amount Other (Numeric) 000000000000
Terminal Country Code 0826
Terminal Verification Results 0000000000
Transaction Currency Code 0826
Transaction Date 190819
Transaction Type 00
Unpredictable Number 3357A30A
Terminal Type 21
Data Authentication Code 0000
ICC Dynamic Number 0000000000000000
Cardholder Verification Method (CVM) Results 1F0302
Transaction Time 120505
Customer Exclusive Data (CED) 0000000000000000000000000000它总共是60 (3C)字节,加上Gen AC报头和Le my消息,则:
80AE50003C000000000100000000000000082600000000000826190819003357A30A21000000000000000000001F03021205050000000000000000000000000000但是,卡片总是返回6700,据我所知,这表示错误的长度。我尝试了一些其他的值,并去掉了Le,但是,我看不出这些值会如何影响长度。
我运行的完整跟踪(使用Xed输出的一些值)是:
Sending 00A404000E325041592E5359532E4444463031
response length: 62
status: 9000
6F | len:3A File Control Information (FCI) Template
84 | len:14 DF Name: 325041592E5359532E4444463031
A5 | len:28 Proprietary Information
BF0C | len:25 File Control Information (FCI) Issuer Discretionary Data
61 | len:23 Directory Entry
4F | len:7 Application Identifier (AID): A0000000041010
50 | len:10 Application Label: 4D617374657243617264
87 | len:1 Application Priority Indicator: 01
9F0A | len:8 Application Selection Registered Proprietary Data list: 0001050400000000
Sending 00A4040007A0000000041010
response length: 81
status: 9000
6F | len:4D File Control Information (FCI) Template
84 | len:7 DF Name: A0000000041010
A5 | len:42 Proprietary Information
50 | len:10 Application Label: 4D617374657243617264
9F12 | len:10 Application Preferred Name: 4D617374657243617264
87 | len:1 Application Priority Indicator: 01
9F11 | len:1 Issuer Code Table Index: 01
5F2D | len:2 Language Preference: 656E
BF0C | len:1A File Control Information (FCI) Issuer Discretionary Data
9F4D | len:2 Log Entry: 0B0A
9F6E | len:7 Form Factor Indicator (qVSDC): 08260000303000
9F0A | len:8 Application Selection Registered Proprietary Data list: 0001050400000000
Sending 80A8000002830000
response length: 22
status: 9000
77 | len:12 Response Message Template Format 2
82 | len:2 Application Interchange Profile: 1980
94 | len:12 Application File Locator: 080101001001010120010200
Sending 00B2011400
response length: 171
status: 9000
70 | len:81 Record Template
9F42 | len:2 Application Currency Code: 0826
5F25 | len:3 Application Effective Date YYMMDD: XXXXXX
5F24 | len:3 Application Expiration Date YYMMDD: XXXXXX
5A | len:8 Application Primary Account Number (PAN): XXXXXXXXXXXXXXXX
5F34 | len:1 Application Primary Account Number (PAN) Sequence Number: 00
9F07 | len:2 Application Usage Control: FF00
9F08 | len:2 Application Version Number: 0002
8C | len:27 Card Risk Management Data Object List 1 (CDOL1)
9F02 | len:06 Amount, Authorised (Numeric)
9F03 | len:06 Amount, Other (Numeric)
9F1A | len:02 Terminal Country Code
95 | len:05 Terminal Verification Results
5F2A | len:02 Transaction Currency Code
9A | len:03 Transaction Date
9C | len:01 Transaction Type
9F37 | len:04 Unpredictable Number
9F35 | len:01 Terminal Type
9F45 | len:02 Data Authentication Code
9F4C | len:08 ICC Dynamic Number
9F34 | len:03 Cardholder Verification Method (CVM) Results
9F21 | len:03 Transaction Time HHMMSS
9F7C | len:14 Customer Exclusive Data (CED)
8D | len:0C Card Risk Management Data Object List 2 (CDOL2)
91 | len:0A Issuer Authentication Data
8A | len:02 Authorisation Response Code
95 | len:05 Terminal Verification Results
9F37 | len:04 Unpredictable Number
9F4C | len:08 ICC Dynamic Number
8E | len:14 Cardholder Verification Method (CVM) List: 000000000000000042031E031F03
9F0D | len:5 Issuer Action Code - Default: B450840000
9F0E | len:5 Issuer Action Code - Denial: 0000000000
9F0F | len:5 Issuer Action Code - Online: B470848000
5F28 | len:2 Issuer Country Code: 0826
9F4A | len:1 Static Data Authentication Tag List: 82
57 | len:19 Track 2 Equivalent Data: ...
Sending 00B2010C00
response length: 112
status: 9000
70 | len:6C Record Template
9F6C | len:2 Card Transaction Qualifiers (CTQ): 0001
9F62 | len:6 PCVC3 Track1 location: 000000380000
9F63 | len:6 PUNATC Track1 location: 00000000E0E0
56 | len:43 Track 1 Equivalent Data: ...
9F64 | len:1 NATC Track1 location: 03
9F65 | len:2 PCVC3 Track2 location: 000E
9F66 | len:2 PUNATC Track2 location: 0E70
9F6B | len:19 Track1 data: ...
9F67 | len:1 NATC Track2 location: 03
Sending 00B2012400
response length: 189
status: 9000
70 | len:81 Record Template
9F47 | len:1 ICC Public Key Expo: 03
9F46 | len:176 ICC Public Key Cert: 8A4...C3
Sending 00B2022400
response length: 229
status: 9000
70 | len:81 Record Template
8F | len:1 Certification Authority Public Key Index: 05
9F32 | len:1 Issuer Public Key Exponent: 03
92 | len:36 Issuer Public Key Remainder: EEAAE75B30426DEB86F113DFD1B53E7D98D6456172ECFA87F83A3E7733341572B1AC1CE9
90 | len:176 Issuer Public Key Certificate: 3E9C8727E2...2FAF87606
Sending 80AE50003C000000000100000000000000082600000000000826190819003357A30A21000000000000000000001F03021205050000000000000000000000000000
response length: 2
Error: 6700我本以为对最终命令的回复应该是AC,或者输入中的一个错误,而不是6700长度错误消息。
发布于 2019-08-21 00:19:49
你读错了9F7C的长度。它是0x14而不是14小数。此卡应用程序的长度应为66 (0x42)。
您可能还想知道的是,ICCPK证书也包含PAN,所以您的Xed还不够(516273*2854)。由于您正在尝试进行CDA事务,因此您应该在公钥检索过程中了解更多有关该事务的信息。
https://stackoverflow.com/questions/57577064
复制相似问题