简体   繁体   English

如何修改 JavaCard j2a040 的 ATR

[英]How to modify an ATR of a JavaCard j2a040

I am trying to change the ATR of a Java Smartcard (JCOP) J2A040.我正在尝试更改 Java 智能卡 (JCOP) J2A040 的 ATR。 I researched through the manuals and cannot find a definite answer.我研究了手册,找不到明确的答案。 There are programs like PyResMan that successfully change it, however, I cannot figure out a way to change it through python .有像 PyResMan 这样的程序可以成功更改它,但是,我无法找到通过python更改它的方法。

I am researching smartcard integration and need to understand how one can go about changing the ATR.我正在研究智能卡集成,需要了解如何更改 ATR。 I know that is has something to do with APDU, however, I cannot figure it out.我知道这与 APDU 有关,但是,我无法弄清楚。

If anyone has any answers, please let me know.如果有人有任何答案,请告诉我。

It is possible to change it from an Applet itself or possibly from the vendor initialization process of the chip.可以从 Applet 本身更改它,也可以从芯片的供应商初始化过程更改它。 The Global Platform specifications allow you to set it through a static call to GPSystem within the GP on-card API: Global Platform 规范允许您通过在 GP on-card API 中对GPSystem的静态调用来设置它:

 public static boolean setATRHistBytes (byte[] buffer, short bOffset, byte bLength)

This method sets the historical bytes contained in the ATR (Answer To Reset).此方法设置 ATR(复位应答)中包含的历史字节。 The sequence of bytes will be set on a subsequent power-up or reset.字节序列将在随后的上电或复位时设置。 Only the “default selected” Application may invoke this method.只有“默认选择”的应用程序可以调用此方法。 The Card Manager locates the AID of the selected Application in the GlobalPlatform Registry and determines if the Application has the required privilege. Card Manager 在 GlobalPlatform Registry 中找到所选应用程序的 AID,并确定该应用程序是否具有所需的权限。

As you can see this only changes the historical bytes which are part of the ATR.如您所见,这只更改了作为 ATR 一部分的历史字节。 The other settings are chip-specific and can therefore normally only be set during initialization of the (Java Card) operating system implementation.其他设置是特定于芯片的,因此通常只能在(Java Card)操作系统实现的初始化期间进行设置。

For JCOP that can be by writing specific byte values to persistent memory (separate locations for cold and warm reset if that's still the same).对于 JCOP,可以通过将特定字节值写入持久内存(如果仍然相同,则为冷复位和热复位的单独位置)。 Please contact your representative to get the necessary documentation and authentication material.请联系您的代表以获取必要的文件和认证材料。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM