为什么我无法从JavaCard中删除未使用的包?

时间:2016-01-16 07:47:07

标签: javacard globalplatform gemalto

我有一张 Gemalto Top DL v2 java卡。当我list内容时,卡中加载了很多包:

GlobalPlatformPro:> gp -visa2 -key 47454D5850524553534F53414D504C45 -list
AID: A000000018434D00 (|.....CM.|)
     ISD OP_READY: Security Domain, Card lock, Card terminate, Default selected, CVM (PIN) management

AID: A0000000620001 (|....b..|)
     ExM LOADED: (none)

AID: A0000000620002 (|....b..|)
     ExM LOADED: (none)

AID: A0000000620003 (|....b..|)
     ExM LOADED: (none)

AID: A0000000620101 (|....b..|)
     ExM LOADED: (none)

AID: A000000062010101 (|....b...|)
     ExM LOADED: (none)

AID: A0000000620102 (|....b..|)
     ExM LOADED: (none)

AID: A0000000620201 (|....b..|)
     ExM LOADED: (none)

AID: A0000000030000 (|.......|)
     ExM LOADED: (none)

AID: A000000018100201 (|........|)
     ExM LOADED: (none)

AID: A000000018100101 (|........|)
     ExM LOADED: (none)
     A000000018534441 (|.....SDA|)

AID: A00000015100 (|....Q.|)
     ExM LOADED: (none)

现在,我想删除未使用的包:

GlobalPlatformPro:> gp -visa2 -key 47454D5850524553534F53414D504C45 -delete A0000000620001 -deletedeps
Could not delete AID: A0000000620001
TIP: Maybe try with --deletedeps
openkms.gp.GPException: Deletion failed SW: 6985
        at openkms.gp.GlobalPlatform.check(GlobalPlatform.java:1039)
        at openkms.gp.GlobalPlatform.deleteAID(GlobalPlatform.java:814)
        at openkms.gp.GPTool.main(GPTool.java:367)

GlobalPlatformPro:> gp -visa2 -key 47454D5850524553534F53414D504C45 -delete A0000000620002 -deletedeps
Could not delete AID: A0000000620002
TIP: Maybe try with --deletedeps
openkms.gp.GPException: Deletion failed SW: 6985
        at openkms.gp.GlobalPlatform.check(GlobalPlatform.java:1039)
        at openkms.gp.GlobalPlatform.deleteAID(GlobalPlatform.java:814)
        at openkms.gp.GPTool.main(GPTool.java:367)

GlobalPlatformPro:> gp -visa2 -key 47454D5850524553534F53414D504C45 -delete A0000000620003 -deletedeps
Could not delete AID: A0000000620003
TIP: Maybe try with --deletedeps
openkms.gp.GPException: Deletion failed SW: 6985
        at openkms.gp.GlobalPlatform.check(GlobalPlatform.java:1039)
        at openkms.gp.GlobalPlatform.deleteAID(GlobalPlatform.java:814)
        at openkms.gp.GPTool.main(GPTool.java:367)

GlobalPlatformPro:> gp -visa2 -key 47454D5850524553534F53414D504C45 -delete A0000000620101 -deletedeps
Could not delete AID: A0000000620101
TIP: Maybe try with --deletedeps
openkms.gp.GPException: Deletion failed SW: 6985
        at openkms.gp.GlobalPlatform.check(GlobalPlatform.java:1039)
        at openkms.gp.GlobalPlatform.deleteAID(GlobalPlatform.java:814)
        at openkms.gp.GPTool.main(GPTool.java:367)

GlobalPlatformPro:> gp -visa2 -key 47454D5850524553534F53414D504C45 -delete A000000062010101 -deletedeps
Could not delete AID: A000000062010101
TIP: Maybe try with --deletedeps
openkms.gp.GPException: Deletion failed SW: 6985
        at openkms.gp.GlobalPlatform.check(GlobalPlatform.java:1039)
        at openkms.gp.GlobalPlatform.deleteAID(GlobalPlatform.java:814)
        at openkms.gp.GPTool.main(GPTool.java:367)

GlobalPlatformPro:> gp -visa2 -key 47454D5850524553534F53414D504C45 -delete A0000000620102 -deletedeps
Could not delete AID: A0000000620102
TIP: Maybe try with --deletedeps
openkms.gp.GPException: Deletion failed SW: 6985
        at openkms.gp.GlobalPlatform.check(GlobalPlatform.java:1039)
        at openkms.gp.GlobalPlatform.deleteAID(GlobalPlatform.java:814)
        at openkms.gp.GPTool.main(GPTool.java:367)

GlobalPlatformPro:> gp -visa2 -key 47454D5850524553534F53414D504C45 -delete  A0000000620201 -deletedeps
Could not delete AID: A0000000620201
TIP: Maybe try with --deletedeps
openkms.gp.GPException: Deletion failed SW: 6985
        at openkms.gp.GlobalPlatform.check(GlobalPlatform.java:1039)
        at openkms.gp.GlobalPlatform.deleteAID(GlobalPlatform.java:814)
        at openkms.gp.GPTool.main(GPTool.java:367)

GlobalPlatformPro:> gp -visa2 -key 47454D5850524553534F53414D504C45 -delete  A0000000030000 -deletedeps
Could not delete AID: A0000000030000
TIP: Maybe try with --deletedeps
openkms.gp.GPException: Deletion failed SW: 6985
        at openkms.gp.GlobalPlatform.check(GlobalPlatform.java:1039)
        at openkms.gp.GlobalPlatform.deleteAID(GlobalPlatform.java:814)
        at openkms.gp.GPTool.main(GPTool.java:367)

GlobalPlatformPro:> gp -visa2 -key 47454D5850524553534F53414D504C45 -delete  A000000018100201 -deletedeps
Could not delete AID: A000000018100201
TIP: Maybe try with --deletedeps
openkms.gp.GPException: Deletion failed SW: 6985
        at openkms.gp.GlobalPlatform.check(GlobalPlatform.java:1039)
        at openkms.gp.GlobalPlatform.deleteAID(GlobalPlatform.java:814)
        at openkms.gp.GPTool.main(GPTool.java:367)

GlobalPlatformPro:> gp -visa2 -key 47454D5850524553534F53414D504C45 -delete  A000000018100101 -deletedeps
Could not delete AID: A000000018100101
TIP: Maybe try with --deletedeps
openkms.gp.GPException: Deletion failed SW: 6985
        at openkms.gp.GlobalPlatform.check(GlobalPlatform.java:1039)
        at openkms.gp.GlobalPlatform.deleteAID(GlobalPlatform.java:814)
        at openkms.gp.GPTool.main(GPTool.java:367)

GlobalPlatformPro:> gp -visa2 -key 47454D5850524553534F53414D504C45 -delete  A00000015100 -deletedeps
Could not delete AID: A00000015100
TIP: Maybe try with --deletedeps
openkms.gp.GPException: Deletion failed SW: 6985
        at openkms.gp.GlobalPlatform.check(GlobalPlatform.java:1039)
        at openkms.gp.GlobalPlatform.deleteAID(GlobalPlatform.java:814)
        at openkms.gp.GPTool.main(GPTool.java:367)

问题是为什么我不能删除它们并释放我的卡的内存?

1 个答案:

答案 0 :(得分:4)

答案

您如何确定这些包未使用? applet可以设计为使用单独的库和/或服务。这些库/服务在GP中有自己的AID,但您首先需要删除所有applet实例和applet模块 - 按顺序删除它们。

很多卡都包含ROM中的预安装软件。 ROM掩码中的空间不能重复用于其他任何内容。删除这些模块不会释放许多资源。如果删除成功,您基本上只会从注册表中删除AID。如果您想要上传同一个库的新版本,这可能很有用,但除此之外它不会产生太大影响。

AID和RID&#392解释

AID由两部分组成:一个5字节的RID和一个可变大小的扩展(称为PIX),用于标识实体的RID。该实体仅在应用程序DF中,但对于Java卡模块也由AID标识。

现在我已经获得了一份RID列表:

  • A000000018434D00安全域来自Gemplus(现为金雅拓);
  • A0000000620001A0000000620002A0000000620003A0000000620101A000000062010101A0000000620102A0000000620201都是Sun(现在是Oracle) )模块;他们contain extensions to the basic Java Card runtime;
  • A0000000030000是旧VISA RID下的卡片管理员;
  • A000000018100201A000000018100101是来自金雅拓的扩展模块或小程序;
  • A00000015100是全球平台AID下的卡片管理员;

A0000000030000 AID正在逐步淘汰 - VISA是Open Platform的创始人,现在是全球平台。 GP现在应该使用他们自己的RID。

说明:

  • 库只是代码和常量,服务包含可以通过对象共享机制使用的状态;
  • 显而易见:对于特定卡,您可能需要与供应商联系以了解其配置方式。