简体   繁体   English

Java Card中的Applet ID和APDU

[英]Applet ID's and APDU in Java Card

In my project i want to write biometric data (like fingerprint template) on a smart card. 在我的项目中,我想在智能卡上编写生物识别数据(如指纹模板)。 After some good study i chose Java card for my project. 经过一番精心研究后,我为我的项目选择了Java卡。 But i am new to this platform and know very little about this :( 但我是这个平台的新手,对此知之甚少:(

I have read tutorials from Sun also, but was unable to resolve some confusions: 我也阅读过Sun的教程,但无法解决一些混淆:

1.) I just want to read and write biometric data from the card, so is it necessary to design applet for it on java card? 1.)我只是想从卡上读取和写入生物识别数据,所以是否有必要在Java卡上设计applet? Can't i use simple read/write functions of a smart card reader to read/write biometric data on the smart card's memory? 我不能使用智能卡读卡器的简单读/写功能来读/写智能卡内存上的生物识别数据吗?

2.) If i create an applet for java card then how i am going to give applet id to it? 2.)如果我为java卡创建一个小程序,那么我将如何给它applet id? Applet id is unique to each applet. Applet id对每个applet都是唯一的。 And, how can i know the applet id for the pre-created applets? 而且,我怎么知道预先创建的applet的applet id?

3.) What are Application Protocol Data Unit (APDU's)? 3.)什么是应用协议数据单元(APDU)? And, how are they going to help me in reading/writing data on the card? 而且,他们如何帮助我读取/写入卡上的数据?

I know all these are basic questions but i am really confused. 我知道所有这些都是基本问题,但我真的很困惑。 So please help out guys! 所以请帮帮我们!

Thanks in advance. 提前致谢。

I will try to answer your questions: 我会尽力回答你的问题:

1) If there is nothing pre-installed on the card that supports writing and reading biometric data you should create your own applet doing the job. 1)如果卡上没有预装任何支持写入和读取生物识别数据的内容,您应该创建自己的小程序来完成工作。

2) Concerning the AID you are right that you should try make it unique. 2)关于AID,你应该尝试使其独一无二。 The structure of the AID is the following : 5 bytes RID + 0..11 bytes PIX AID的结构如下:5个字节RID + 0..11个字节PIX

RID is unique identifier of the application provider. RID是应用程序提供者的唯一标识符。 In order to make sure that nobody else use your RID you should register it in a national or international certification institutions, depending on the scope of your application. 为了确保没有其他人使用您的RID,您应该在国家或国际认证机构注册,具体取决于您的申请范围。 Although, it is not mandatory to have registered RID only requirement is that you should use "F" as a start of your RID if it is not registered. 虽然,仅注册RID并非强制要求,如果未注册,则应使用“F”作为RID的开头。 It is recommend to use only registered AID if you implement serious application. 如果您实施严肃的申请,建议仅使用已注册的AID。

PIX is Proprietary Application Identifier Extension that application provided should maintain its uniqueness. PIX是专有应用程序标识符扩展,提供的应用程序应保持其唯一性。

3) APDUs is just protocol describing the way of communicating with your applet. 3)APDU只是描述与applet通信方式的协议。 It wraps the instruction that you want to call together with the input and output data. 它包含您要与输入和输出数据一起调用的指令。

APDUs are the "commands" you send to the smart card. APDU是您发送到智能卡的“命令”。

Javacards (and applets installed on javacards) support specific APDUs depending on what applets are installed (and specific APDUs for installing applets.) The javacard documentation is the best place to start learning about this. Javacards(以及安装在javacards上的applet)支持特定的APDU,具体取决于安装的applet(以及用于安装applet的特定APDU).javacard文档是开始了解这一点的最佳位置。

Some smart cards come with applets pre-installed that have space reserved for biometric data; 一些智能卡附带预装的小程序,其中有为生物识别数据保留的空间; for example, "PIV" cards (and associated applet). 例如,“PIV”卡(和相关的小程序)。

If your card doesn't have an applet pre-installed for storing biometric data you will need to write and install one. 如果您的卡没有预先安装用于存储生物识别数据的小程序,则需要编写并安装一个小程序。

Hope this helps. 希望这可以帮助。

An example for APDU Command: 00 A4 04 00 0A A0 00 00 00 62 03 01 0C 01 01 CLA INS P1 P2 Lc Data field Le APDU命令的示例:00 A4 04 00 0A A0 00 00 00 62 03 01 0C 01 01 CLA INS P1 P2 Lc数据字段Le

1st byte: CLA, it is an command type. 第一个字节:CLA,它是一个命令类型。 For example 80 means Global platform defined commands are used. 例如,80表示使用全局平台定义的命令。

2nd Byte: INS, instruction code. 第二字节:INS,指令代码。

3rd Byte: P1, parameter 1. 第3字节:P1,参数1。

4th Byte: P2, parameter 2. 第4字节:P2,参数2。

5th and 6th bytes : Length of data excluding length of size, CLA, P1, P2 and le. 第5和第6字节:不包括大小长度,CLA,P1,P2和le的数据长度。

7th. 第7位。 byte to last byte: Data 字节到最后一个字节:数据

Last Byte: Le which is generally 00. 最后一个字节:Le通常为00。

For more information please see Global Platform's documents. 有关更多信息,请参阅Global Platform的文档。 http://globalplatform.org/specificationscard.asp http://globalplatform.org/specificationscard.asp

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

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