简体   繁体   English

将扩展APDU发送到Javacard

[英]Sending Extended APDU to Javacard

I have a ACR38 samrt-card-reader and a number of Javacard [2.1.1] compliant with GP Spec [02]. 我有一台ACR38 samrt-card-reader和一些符合GP Spec [02]的Javacard [2.1.1]。

As I know, there is two kind of APDU, Short-APDU [APDU with LC or/and LE shorter than 255 ] and Extended-APDU [APDU with LC or/and LE greater than 255 ]. 据我所知,存在两种APDU, 短APDU [具有LC或/和LE短于255 的APDU ]和扩展APDU [具有LC或/和LE大于255 APDU]。

is that right? 那正确吗?

We send Short-APDU in T=0 protocol and send Extended-APDU in T=1 protocol. 我们在T=0协议中发送Short-APDU并在T=1协议中发送扩展APDU。

is that right? 那正确吗?


I sent Short-APDU to my card successfully. 我成功地将Short-APDU发送到了我的卡。 [via GPJ , GPShell , OpenSC-Tool ]. [通过GPJGPShellOpenSC-Tool ]。

And now, I want to know: 现在,我想知道:

1: if I want to use Extended APDU, my card must support it? 1:如果我想使用扩展APDU,我的卡必须支持它吗? or my Reader must support it? 或者我的读者必须支持它? or both!? 或两者!? or all the cards and all the readers support both Short-APDUs and Extended-APDUs? 或所有卡和所有读卡器都支持短APDU和扩展APDU?

2: if them must support EXTENDED-APDU, how I can check those are compliant or not? 2:如果他们必须支持EXTENDED-APDU,我怎么能检查那些是否合规?

3: Am I need another tool or I can use same GPJ,GPShell and Opensc-tool to send Extended-APDU? 3:我需要其他工具还是可以使用相同的GPJ,GPShell和Opensc工具发送Extended-APDU? how? 怎么样?


Update: I found below data here , but I'll be thankful if someone give me more detailed data : 更新:我在这里找到了以下数据,但如果有人给我更详细的数据,我将感激不尽:

To be able to use an extended APDU you need to have: 为了能够使用扩展的APDU,您需要:

  • AT=1 card AT = 1卡
  • A smart card reader working in TPDU or Extended APDU 在TPDU或扩展APDU中工作的智能卡读卡器

A smart card reader can work using 4 different exchange levels: 智能卡读卡器可以使用4种不同的交换级别:

  • Character 字符
  • TPDU TPDU
  • Short APDU 短APDU
  • Short and extended APDU 短和扩展的APDU

Character level: Only very few readers work using this method. 角色等级:只有极少数读者使用此方法。 I don't know if/how they support extended APDU. 我不知道他们是否/如何支持扩展APDU。

TPDU level: With this exchange level a lot of the work is done in the driver. TPDU级别:通过此交换级别,许多工作都在驱动程序中完成。 In particular support of extended APDU is managed by the driver and the CCID driver implements it. 特别是对扩展APDU的支持由驱动程序管理,CCID驱动程序实现它。

Short APDU: These readers are easy to use at a driver point of view but are then limited to short APDU only. 短APDU:这些阅读器在驱动程序的角度很容易使用,但仅限于短APDU。 Support of extended APDU is then not possible. 因此无法支持扩展APDU。

Some readers claim they support short APDU only but can use extended APDU when used with the manufacturer Windows driver. 一些读者声称它们仅支持短APDU,但在与制造商Windows驱动程序一起使用时可以使用扩展APDU。 Maybe the Windows driver switches the reader in TPDU mode or something similar. 也许Windows驱动程序在TPDU模式或类似的东西中切换阅读器。 That is not a documented CCID feature and so is not used in my CCID driver. 这不是一个记录的CCID功能,因此不在我的CCID驱动程序中使用。 If you can get information on this from the reader manufacturer I may include support of extended APDU for the reader in my driver. 如果您可以从阅读器制造商处获得有关此信息,我可能会在驱动程序中为阅读器提供扩展APDU支持。

Short and extended APDU: Support of extended APDU is offered by the reader. 短和扩展APDU:读者提供对扩展APDU的支持。

I think base on the above update section I conclude that the card and the reader must support EXTENDED-APDU.and for check if those are compliant with extended APDU, I must search for the product documents and also the sites that give us a list of readers that support extended APDU. 我认为基于上面的更新部分,我得出结论,卡和读卡器必须支持EXTENDED-APDU。并检查这些是否符合扩展APDU,我必须搜索产品文档以及提供给我们列表的网站支持扩展APDU的读者。 is it right? 这样对吗?

you can send Extended APDU in T=0 as well but for that your card must be supported "javacardx.apdu". 您也可以在T = 0中发送扩展APDU,但为此必须支持您的卡“javacardx.apdu”。 Please refer javadoc link 请参考javadoc链接

Here is method to know what is supported by your card. 这是了解您的卡支持的方法。

00 A4 04 00 <length of Card manager AID> <AID> [Select card manager]

00 20 00 00 08 <Card manager PIN> [verify card manager PIN]

00 80 F2 20 00 02 4F 00 - [get status command with P1 20] and [Executable Load Files and Executable Modules 4F00]

You will get all the package AID in response of this command then search for AID "A0000000620209". 您将获得响应此命令的所有包AID,然后搜索AID“A0000000620209”。

if available then javacardx.apdu is supported. 如果可用,则支持javacardx.apdu。 For more info abt "Get status" command please refer GP 2.2.1 有关更多信息,请参阅“获取状态”命令,请参阅GP 2.2.1

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

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