Javacard - 垃圾收集期间的电力损失 [英] Javacard - power loss during garbage collection

查看:152
本文介绍了Javacard - 垃圾收集期间的电力损失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到我的智能卡上有一些非常奇怪的行为(恩智浦J2E145,J3A081,带有Omnikey 5121阅读器的J3C145):调用JavaCard方法后的权力损失

<$ p $可能会损坏网卡:大约10次后,可能会损坏卡: JCSystem.requestObjectDeletion()

ATR命令的%很慢(1000ms),我对任何其他APDU(小程序选择,卡片管理器认证等)都没有响应。

I知道requestObjectDeletion()的行为取决于供应商的具体实现,所以我的问题是相当广泛和开放的......



是垃圾收集处理通常在一个单一交易?

是否有任何官方建议不要在可能的电力损失情况下调用requestObjectDeletion()?

                     b


  • JCSystem.isObjectDeletionSupported()==在所有智能卡上都是如此。

  • 当试图连接受损卡的卡片管理器小程序时,Eclipse IDE中的JCOP shell会报告:



    ATR:3BFB9600008131FE454F4450204D41502053414D3E

    ATR:
    T = 1

    jcshell:终端未知问题。
    上次终端错误:由于I / O设备错误,请求无法执行。
  • >解决方案

嗯,我认为这可能是一个执行错误。一般来说,垃圾回收通常是不需要的,并且从不在智能卡上使用。在任何情况下,您都应该通过良好的小程序设计来避免它。因为这样你永远不会遇到内存问题,这对于在其生命周期的其余部分中一次性安装的智能卡是不利的。无论如何,垃圾收集只需要很长时间,也许这就是为什么卡系统程序员不希望它发生在安全环境之外。

I noticed some very strange behaviour on my smartcards (NXP J2E145, J3A081, J3C145 with an Omnikey 5121 reader): A power loss right after calling JavaCard method

JCSystem.requestObjectDeletion()

can damage the card: after about 10% of such power cuts the ATR command is very slow (1000ms) and I get no response to any other APDUs (applet selection, card manager authentication etc.).

I know that the behavior of requestObjectDeletion() depends on the vendor specific implementation, so my question is quite wide and open...

Is garbage collecting processed "usually" in a single transaction?

Is there any "official" recommendation NOT to call requestObjectDeletion() in case of a possible power loss?

Do you have any similar experience with cards by NXP?

EDIT:

  • JCSystem.isObjectDeletionSupported() == true on all my smartcards.
  • When trying to connect to the card manager applet of a damaged card, the JCOP shell in Eclipse IDE reports this:

    ATR: 3BFB9600008131FE454F4450204D41502053414D3E

    ATR: T = 1
    jcshell: Unknown problems with terminal. Last terminal error: The request could not be performed because of an I/O device error.

解决方案

Well I think it might be an implementation bug. In general, garbage collection is usually never needed and never used on smartcards. You should avoided it under any circumstances by good applet design. Because that way you never run into memory problems, which are bad for a smartcard thats installed once in its lifetime and shall be useable for the rest of its lifecycle. Garbage Collection just takes too long anyway and maybe thatswhy the card system programmer didn't expect it to happen outside a safe environment.

这篇关于Javacard - 垃圾收集期间的电力损失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆