为什么我会收到" 6400"在卡上安装.cap文件时APDU响应?

时间:2014-05-26 11:29:51

标签: applet smartcard javacard

我通过this代码的EClipse [JCDK 2.2.1和JDK 1.3编译器 - 与我的javacard兼容]创建了一个.cap文件。当我尝试在我的javacard上传.cap文件时,我收到6400 [执行错误]作为APDU响应。出了什么问题?

注意:该卡正常,我以这种方式上传并安装(和删除)了一些其他小程序。

这是 GPSHELL 输出:

C:\Users\ghasemi\Desktop\GPShell-1.4.4>gpshell helloinstallgp211.txt
mode_211
enable_trace
enable_timer
establish_context
command time: 31 ms
card_connect
command time: 234 ms
select -AID a000000003000000
Command --> 00A4040008A000000003000000
Wrapped command --> 00A4040008A000000003000000
Response <-- 6F108408A000000003000000A5049F6501FF9000
command time: 78 ms
open_sc -security 1 -keyind 0 -keyver 0 -mac_key 404142434445464748494a4b4c4d4e4
f -enc_key 404142434445464748494a4b4c4d4e4f // Open secure channel
Command --> 80CA006600
Wrapped command --> 80CA006600
Response <-- 664C734A06072A864886FC6B01600C060A2A864886FC6B02020101630906072A864
886FC6B03640B06092A864886FC6B040215650B06092B8510864864020103660C060A2B060104012
A026E01029000
Command --> 80500000089745473D878BB66100
Wrapped command --> 80500000089745473D878BB66100
Response <-- 0000116001007F8B0AF902020138983B77E636B6B6B2DC1A4561E0FA9000
Command --> 8482010010634A7AB0D595678BE372CC0985B04699
Wrapped command --> 8482010010634A7AB0D595678BE372CC0985B04699
Response <-- 9000
command time: 483 ms
delete -AID D0D1D2D3D4D50101
Command --> 80E400800A4F08D0D1D2D3D4D5010100
Wrapped command --> 84E40080124F08D0D1D2D3D4D5010109D636437BCD79CD00
Response <-- 6A88
delete() returns 0x80206A88 (6A88: Referenced data not found.)
command time: 94 ms
delete -AID D0D1D2D3D4D501
Command --> 80E40080094F07D0D1D2D3D4D50100
Wrapped command --> 84E40080114F07D0D1D2D3D4D501ECD32790E15A204100
Response <-- 6A88
delete() returns 0x80206A88 (6A88: Referenced data not found.)
command time: 109 ms
install -file packtangen.cap -nvDataLimit 2000 -instParam 00 -priv 2
Command --> 80E60200210A0102030405060708090008A000000003000000000AEF08C6020758C8
0207D00000
Wrapped command --> 84E60200290A0102030405060708090008A000000003000000000AEF08C6
020758C80207D0002AD608C954B0685500
Response <-- 009000
Command --> 80E80000EFC482074A010014DECAFFED01020400010A010203040506070809000200
1F0014001F000F001500B200100403001500950000016600140002000502010004001502020107A0
000000620101020107A000000062010203000F010B01020304050607080900000008060010008003
00FF0007030000006F03A703C4070403000110188C00007A043007900B7F00011008900B7F000210
14058D00037F00048F00053D05068C00067F00077B00077B000803068B00098F00053D06058C0006
7F000A7B000A7B000B03058B0009061040038D000C9400000D7F000E06038D000F7F00108F00113D
8C00128B00137A042119
Wrapped command --> 84E80000F7C482074A010014DECAFFED01020400010A0102030405060708
090002001F0014001F000F001500B200100403001500950000016600140002000502010004001502
020107A0000000620101020107A000000062010203000F010B010203040506070809000000080600
1000800300FF0007030000006F03A703C4070403000110188C00007A043007900B7F00011008900B
7F00021014058D00037F00048F00053D05068C00067F00077B00077B000803068B00098F00053D06
058C00067F000A7B000A7B000B03058B0009061040038D000C9400000D7F000E06038D000F7F0010
8F00113D8C00128B00137A0421198265218229B84F3B
Response <-- 009000
Command --> 80E80001EF8B00142D7B0004031014038D00153B1A0325613E1A04257500310004FF
A40015FFCA002AFFDA00230020001C18198C0016702518198C0017701E18198C0018701718198C00
197010116D008D001A7008116E008D001A7A0422198B00142D1A0525076A08116B008D001A1A0625
6008116B008D001A1A07251100FF533218198B001B8D001C1A081F5B8B001D61081169998D001A11
90008D001A7A0423198B00142D1A05256008116B008D001A1A07251100FF533218198B001B1A0625
046B2A1F056A081167008D001A7B000A1A08058B001E61497B000A8B001F29041163C01604418D00
1A70361A0625056B2A1F
Wrapped command --> 84E80001F78B00142D7B0004031014038D00153B1A0325613E1A04257500
310004FFA40015FFCA002AFFDA00230020001C18198C0016702518198C0017701E18198C00187017
18198C00197010116D008D001A7008116E008D001A7A0422198B00142D1A0525076A08116B008D00
1A1A06256008116B008D001A1A07251100FF533218198B001B8D001C1A081F5B8B001D6108116999
8D001A1190008D001A7A0423198B00142D1A05256008116B008D001A1A07251100FF533218198B00
1B1A0625046B2A1F056A081167008D001A7B000A1A08058B001E61497B000A8B001F29041163C016
04418D001A70361A0625056B2A1F129A4E6945A08E41
Response <-- 009000
Command --> 80E80002EF066A081167008D001A7B00071A08068B001E611B7B00078B001F290411
63C01604418D001A7008116B008D001A1190008D001A7A0523198B00142D1A05256008116B008D00
1A1A06251100FF53321F10406C081F1100FE6F08116B008D001A1A07251100FF53290418198B001B
7B00078B002061081169828D001A1F7300ED0050005600D40015003A00ED00BA005F00851604056A
081167008D001A1A087B00040316048D00213B7B000A7B000403058B0009A800BC1604066A081167
008D001A1A087B00040316048D00213B7B00077B000403068B0009A80097160410086A081167008D
001A1A087B0004031604
Wrapped command --> 84E80002F7066A081167008D001A7B00071A08068B001E611B7B00078B00
1F29041163C01604418D001A7008116B008D001A1190008D001A7A0523198B00142D1A0525600811
6B008D001A1A06251100FF53321F10406C081F1100FE6F08116B008D001A1A07251100FF53290418
198B001B7B00078B002061081169828D001A1F7300ED0050005600D40015003A00ED00BA005F0085
1604056A081167008D001A1A087B00040316048D00213B7B000A7B000403058B0009A800BC160406
6A081167008D001A1A087B00040316048D00213B7B00077B000403068B0009A80097160410086A08
1167008D001A1A087B000403160464A4DA978927798D
Response <-- 009000
Command --> 80E80003EF8D00213B7B000E7B0004038E03000D0570701604056A081167008D001A
1A087B00040316048D00213B7B0004038D0022117FFF6F08116A808D001A7B0004038D0022810023
703B160410086A081167008D001A1A087B00020316048D00213B70211604076A081167008D001A1A
087B00010316048D00213B7008116A888D001A1190008D001A7A0523198B00142D1A05256008116B
008D001A1A06251100FF53321F10406C081F1100FE6F08116B008D001A1A07251100FF5329041F75
007F0003005000110056002C005700441604076A081167008D001A7B0001037B00040316048D0021
3B705B1604056A081167
Wrapped command --> 84E80003F78D00213B7B000E7B0004038E03000D0570701604056A081167
008D001A1A087B00040316048D00213B7B0004038D0022117FFF6F08116A808D001A7B0004038D00
22810023703B160410086A081167008D001A1A087B00020316048D00213B70211604076A08116700
8D001A1A087B00010316048D00213B7008116A888D001A1190008D001A7A0523198B00142D1A0525
6008116B008D001A1A06251100FF53321F10406C081F1100FE6F08116B008D001A1A07251100FF53
29041F75007F0003005000110056002C005700441604076A081167008D001A7B0001037B00040316
048D00213B705B1604056A081167517DA1541AF712B6
Response <-- 009000
Command --> 80E80004EF008D001A7B0004037D00238D00243B70431604076A081167008D001A7B
000A8B002061081169828D001A7D0023117FFF6C081169848D001A188B00257B0004100A7B000403
078D00213B7008116A888D001A198B00263B1916048B0027197B00040316048B00287A0222198B00
142D1A07251100FF53321F198B00296A081167008D001A7A06117B0004037D00238D00243B7B0002
037B00040510088D00213B7B00107B000E048B002A7B00107B000403077B0004100A8B002B307D00
2304418100237A0800150014000900020300032222220300020000000200000500B2002C06800300
05000004050000080680
Wrapped command --> 84E80004F7008D001A7B0004037D00238D00243B70431604076A08116700
8D001A7B000A8B002061081169828D001A7D0023117FFF6C081169848D001A188B00257B0004100A
7B000403078D00213B7008116A888D001A198B00263B1916048B0027197B00040316048B00287A02
22198B00142D1A07251100FF53321F198B00296A081167008D001A7A06117B0004037D00238D0024
3B7B0002037B00040510088D00213B7B00107B000E048B002A7B00107B000403077B0004100A8B00
2B307D002304418100237A0800150014000900020300032222220300020000000200000500B2002C
0680030005000004050000080680D8E32B1F70A81CF1
Response <-- 009000
Command --> 80E80005EF080D0500000601800900068009000500000E0500000003800908050000
100500000206810D0001810A000500000A06810F000500000C01000000060000010380030103800A
0106801003060000C90600010D06000195060002D706800701030000080680080303800602038009
010380090203800904068010010680100405000012068010060300000903800A0703800A0903800A
0503800A0603810F0303810F05090095000000910509070603030603030305030603030305070403
0503030403070407230707070808070D0B0D03070806070C0D10030605030B12030605030B080607
0C190E03030821050604
Wrapped command --> 84E80005F7080D0500000601800900068009000500000E05000000038009
08050000100500000206810D0001810A000500000A06810F000500000C0100000006000001038003
0103800A0106801003060000C90600010D06000195060002D7068007010300000806800803038006
02038009010380090203800904068010010680100405000012068010060300000903800A0703800A
0903800A0503800A0603810F0303810F050900950000009105090706030306030303050306030303
050704030503030403070407230707070808070D0B0D03070806070C0D10030605030B1203060503
0B0806070C190E03030821050604B4F3E551167260C8
Response <-- 009000
Command --> 80E80006EF03050E05060403050F05060403050E050604040B0304030E05060E0506
0906070C19260304060E0304030E030308030B040305050904070406070E08060403040406040304
0303050504050B0166010001000000000A0009FF18000000005CFF18000002005CFF08000004005C
FF08000006005CFF08000008005CFF0800000A0070FF0800000C0079FF0800000E0064FF08000010
0064FF08000012800400810001005A0005000000000109000800680065000000000701006F008100
5800000000FF0200C90081004200000000FF02010D0081008600000000FF02019500810140000000
00FF0202D7008100CE00
Wrapped command --> 84E80006F703050E05060403050F05060403050E050604040B0304030E05
060E05060906070C19260304060E0304030E030308030B040305050904070406070E080604030404
060403040303050504050B0166010001000000000A0009FF18000000005CFF18000002005CFF0800
0004005CFF08000006005CFF08000008005CFF0800000A0070FF0800000C0079FF0800000E0064FF
080000100064FF08000012800400810001005A000500000000010900080068006500000000070100
6F0081005800000000FF0200C90081004200000000FF02010D0081008600000000FF020195008101
4000000000FF0202D7008100CE001A7A4C7761C0C1D3
Response <-- 009000
Command --> 80E88007C5000000080103A70081001B00000000090103C4005A003D00000000002C
005A005C005C005E005CFFFF00610064005C00680064005C006BFFFF007000740079FFFF005A005A
005C007D0081008100810081008500810087008B008B008E0090009200960099009B005A00990085
009E009900A100A6011001B00343B00333100568009004B4310834268100056810A007326810F005
6810F005B44340066800A102410568006004B4320130012006B4B44403B440014004B44404B44107
6810031006B44B4400
Wrapped command --> 84E88007CD000000080103A70081001B00000000090103C4005A003D0000
0000002C005A005C005C005E005CFFFF00610064005C00680064005C006BFFFF007000740079FFFF
005A005A005C007D0081008100810081008500810087008B008B008E0090009200960099009B005A
00990085009E009900A100A6011001B00343B00333100568009004B4310834268100056810A00732
6810F0056810F005B44340066800A102410568006004B4320130012006B4B44403B440014004B444
04B441076810031006B44B44FD30AED775481A8600
Response <-- 009000
Command --> 80E60C00300A010203040506070809000B01020304050607080900000B0102030405
060708090000010209C90100EF04C80207D00000
Wrapped command --> 84E60C00380A010203040506070809000B01020304050607080900000B01
02030405060708090000010209C90100EF04C80207D0002096511CB5FC14DD00
Response <-- 6400
install_for_install_and_make_selectable() returns 0x80206400 (6400: No specific
diagnostic.)

C:\Users\ghasemi\Desktop\GPShell-1.4.4>

1 个答案:

答案 0 :(得分:3)

从源代码中删除行mac = Signature.getInstance(Signature.ALG_DES_MAC4_ISO9797_M1, false);,然后生成新的.cap文件并成功上载和安装。 所以我想这个问题来自于我的卡支持的算法和代码中使用的算法之间的不一致。