问题描述
如何从卡中获取Java卡版本?有什么方法可以从卡中获取JC版本.还是我应该尝试为每个JC版本选项安装特定的小程序.
How to get java card version from card?Is there any way how to get version of JC from the card. Or should I try to install applets with specific for each JC version options.
推荐答案
确定白色"智能卡支持的JavaCard API版本的唯一完整方法是为每个JavaCard版本构建一个单独的CAP文件.
The only full-proof way to determine JavaCard API versions supported by a "white" smart card is to build a separate CAP file for each JavaCard version.
我建议您使每个CAP仅包含一个扩展javacard.framework.Applet
的简单类.您可能希望能够实际安装您的简单小程序并与其实际交换APDU,只是为了确保它确实有效.据我所知,即使尚未解决所有导入问题,也允许Java Card虚拟机实现上载CAP文件,但是如果您尝试实际使用API,则应该会失败.
I suggest you make each CAP contain just a single simple class extending javacard.framework.Applet
. You may want to be able to actually install your simple applet and actually exchange APDUs with it just to make sure it actually works; as far as I know Java Card virtual machine implementations are allowed to upload CAP files even if not all imports are resolved, but should fail if you try to actually use the APIs.
生成CAP文件后,您可以通过解析生成的CAP文件中的COMPONENT_Import组件来验证它是否确实链接到了预期的JavaCard API包. CAP文件格式在JavaCard虚拟机规范中进行了描述,您想要的字段是导入的JavaCard软件包的package_info.
Once a CAP file is generated you can verify it actually links to the intended JavaCard API package by parsing the COMPONENT_Import component in your generated CAP file. The CAP file format is described in the JavaCard Virtual Machine Specification and the field you want is the package_info for your imported JavaCard package.
我已经包含了一个AID列表-package_version_major.package_version_minor(package_name)信息.该列表可能不完整.
I've comprised a list of AID - package_version_major.package_version_minor (package_name) information. The list may be incomplete.
Java卡2.1.1 :A0000000620201-1.1(javacardx.crypto)
Java Card 2.1.1: A0000000620201 - 1.1 (javacardx.crypto)
Java Card 2.1.1 :A0000000620101-1.0(javacard.framework)
Java Card 2.1.1: A0000000620101 - 1.0 (javacard.framework)
Java卡2.1.1 :A0000000620001-1.0(java.lang)
Java Card 2.1.1: A0000000620001 - 1.0 (java.lang)
Java Card 2.1.1 :A0000000620102-1.1(javacard.security)
Java Card 2.1.1: A0000000620102 - 1.1 (javacard.security)
Java卡2.2.1 :A0000000620201-1.2(javacardx.crypto)
Java Card 2.2.1: A0000000620201 - 1.2 (javacardx.crypto)
Java卡2.2.1 :A0000000620101-1.2(javacard.framework)
Java Card 2.2.1: A0000000620101 - 1.2 (javacard.framework)
Java卡2.2.1 :A0000000620002-1.0(java.io)
Java Card 2.2.1: A0000000620002 - 1.0 (java.io)
Java卡2.2.1 :A0000000620001-1.0(java.lang)
Java Card 2.2.1: A0000000620001 - 1.0 (java.lang)
Java卡2.2.1 :A0000000620003-1.0(java.rmi)
Java Card 2.2.1: A0000000620003 - 1.0 (java.rmi)
Java卡2.2.1 :A0000000620102-1.2(javacard.security)
Java Card 2.2.1: A0000000620102 - 1.2 (javacard.security)
Java Card 2.2.1 :A000000062010101-1.0(javacard.framework.service)
Java Card 2.2.1: A000000062010101 - 1.0 (javacard.framework.service)
Java卡2.2.2 :A0000000620209-1.0(javacardx.apdu)
Java Card 2.2.2: A0000000620209 - 1.0 (javacardx.apdu)
Java卡2.2.2 :A0000000620202-1.2(javacardx.biometry)
Java Card 2.2.2: A0000000620202 - 1.2 (javacardx.biometry)
Java卡2.2.2 :A0000000620201-1.3(javacardx.crypto)
Java Card 2.2.2: A0000000620201 - 1.3 (javacardx.crypto)
Java卡2.2.2 :A0000000620203-1.0(javacardx.external)
Java Card 2.2.2: A0000000620203 - 1.0 (javacardx.external)
Java Card 2.2.2 :A0000000620101-1.3(javacard.framework)
Java Card 2.2.2: A0000000620101 - 1.3 (javacard.framework)
Java卡2.2.2 :A0000000620002-1.0(java.io)
Java Card 2.2.2: A0000000620002 - 1.0 (java.io)
Java卡2.2.2 :A0000000620001-1.0(java.lang)
Java Card 2.2.2: A0000000620001 - 1.0 (java.lang)
Java卡2.2.2 :A000000062020802-1.0(javacardx.framework.math)
Java Card 2.2.2: A000000062020802 - 1.0 (javacardx.framework.math)
Java卡2.2.2 :A0000000620003-1.0(java.rmi)
Java Card 2.2.2: A0000000620003 - 1.0 (java.rmi)
Java卡2.2.2 :A0000000620102-1.3(javacard.security)
Java Card 2.2.2: A0000000620102 - 1.3 (javacard.security)
Java Card 2.2.2 :A000000062010101-1.0(javacard.framework.service)
Java Card 2.2.2: A000000062010101 - 1.0 (javacard.framework.service)
Java Card 2.2.2 :A000000062020803-1.0(javacardx.framework.tlv)
Java Card 2.2.2: A000000062020803 - 1.0 (javacardx.framework.tlv)
Java Card 2.2.2 :A000000062020801-1.0(javacardx.framework.util)
Java Card 2.2.2: A000000062020801 - 1.0 (javacardx.framework.util)
Java Card 3.0.1 :A0000000620209-1.0(javacardx.apdu)
Java Card 3.0.1: A0000000620209 - 1.0 (javacardx.apdu)
Java卡3.0.1 :A0000000620202-1.2(javacardx.biometry)
Java Card 3.0.1: A0000000620202 - 1.2 (javacardx.biometry)
Java卡3.0.1 :A0000000620201-1.4(javacardx.crypto)
Java Card 3.0.1: A0000000620201 - 1.4 (javacardx.crypto)
Java Card 3.0.1 :A0000000620203-1.0(javacardx.external)
Java Card 3.0.1: A0000000620203 - 1.0 (javacardx.external)
Java Card 3.0.1 :A0000000620101-1.4(javacard.framework)
Java Card 3.0.1: A0000000620101 - 1.4 (javacard.framework)
Java卡3.0.1 :A00000006202080101-1.0(javacardx.framework.util.intx)
Java Card 3.0.1: A00000006202080101 - 1.0 (javacardx.framework.util.intx)
Java卡3.0.1 :A0000000620002-1.0(java.io)
Java Card 3.0.1: A0000000620002 - 1.0 (java.io)
Java卡3.0.1 :A0000000620001-1.0(java.lang)
Java Card 3.0.1: A0000000620001 - 1.0 (java.lang)
Java卡3.0.1 :A000000062020802-1.0(javacardx.framework.math)
Java Card 3.0.1: A000000062020802 - 1.0 (javacardx.framework.math)
Java卡3.0.1 :A0000000620003-1.0(java.rmi)
Java Card 3.0.1: A0000000620003 - 1.0 (java.rmi)
Java Card 3.0.1 :A0000000620102-1.4(javacard.security)
Java Card 3.0.1: A0000000620102 - 1.4 (javacard.security)
Java Card 3.0.1 :A000000062010101-1.0(javacard.framework.service)
Java Card 3.0.1: A000000062010101 - 1.0 (javacard.framework.service)
Java Card 3.0.1 :A000000062020803-1.0(javacardx.framework.tlv)
Java Card 3.0.1: A000000062020803 - 1.0 (javacardx.framework.tlv)
Java Card 3.0.1 :A000000062020801-1.0(javacardx.framework.util)
Java Card 3.0.1: A000000062020801 - 1.0 (javacardx.framework.util)
Java Card 3.0.4 :A0000000620209-1.0(javacardx.apdu)
Java Card 3.0.4: A0000000620209 - 1.0 (javacardx.apdu)
Java卡3.0.4 :A0000000620202-1.2(javacardx.biometry)
Java Card 3.0.4: A0000000620202 - 1.2 (javacardx.biometry)
Java卡3.0.4 :A0000000620201-1.4(javacardx.crypto)
Java Card 3.0.4: A0000000620201 - 1.4 (javacardx.crypto)
Java Card 3.0.4 :A0000000620203-1.0(javacardx.external)
Java Card 3.0.4: A0000000620203 - 1.0 (javacardx.external)
Java Card 3.0.4 :A0000000620101-1.5(javacard.framework)
Java Card 3.0.4: A0000000620101 - 1.5 (javacard.framework)
Java Card 3.0.4 :A00000006202080101-1.0(javacardx.framework.util.intx)
Java Card 3.0.4: A00000006202080101 - 1.0 (javacardx.framework.util.intx)
Java卡3.0.4 :A0000000620002-1.0(java.io)
Java Card 3.0.4: A0000000620002 - 1.0 (java.io)
Java卡3.0.4 :A0000000620001-1.0(java.lang)
Java Card 3.0.4: A0000000620001 - 1.0 (java.lang)
Java Card 3.0.4 :A000000062020802-1.0(javacardx.framework.math)
Java Card 3.0.4: A000000062020802 - 1.0 (javacardx.framework.math)
Java Card 3.0.4 :A0000000620003-1.0(java.rmi)
Java Card 3.0.4: A0000000620003 - 1.0 (java.rmi)
Java Card 3.0.4 :A0000000620102-1.5(javacard.security)
Java Card 3.0.4: A0000000620102 - 1.5 (javacard.security)
Java Card 3.0.4 :A000000062010101-1.0(javacard.framework.service)
Java Card 3.0.4: A000000062010101 - 1.0 (javacard.framework.service)
Java Card 3.0.4 :A000000062020804-1.0(javacardx.framework.string)
Java Card 3.0.4: A000000062020804 - 1.0 (javacardx.framework.string)
Java Card 3.0.4 :A000000062020803-1.0(javacardx.framework.tlv)
Java Card 3.0.4: A000000062020803 - 1.0 (javacardx.framework.tlv)
Java Card 3.0.4 :A000000062020801-1.0(javacardx.framework.util)
Java Card 3.0.4: A000000062020801 - 1.0 (javacardx.framework.util)
考虑到以上信息,我可以指出 Michael Roland 的答案是有点误导.调用JCSystem.getVersion()
并不能帮助确定是否支持Java Card版本.如果您可以实际调用该API,那么您已经确定该版本受支持.
Considering above information allow me to point out that the answer from Michael Roland is slightly misleading. Calling JCSystem.getVersion()
does not help to determine whether a Java Card version is supported; if you got to the point where you can actually call the API then you are already sure the version is supported.
这篇关于如何在卡上获取JavaCard版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!