是否有可能用在Java卡选择一个小程序状态字9000一起返回一些数据? [英] is it possible to return some data along with the status word 9000 on selecting an applet in javacard?

查看:287
本文介绍了是否有可能用在Java卡选择一个小程序状态字9000一起返回一些数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如果我能够从Java卡applet被选中时发回一些数据。

i was wondering if i could send back some data from the javacard applet when it is selected.

由于select()方法返回一个布尔值,我不知道如何从它返回的数据字节。

since select() method returns a boolean value i don't know how to return data bytes from it.

谁能帮助我?我想小程序与状态字9000(这是成功的默认值)一起返回一个简单的字节数组,当我发送SELECT命令来卡。

can anyone help me with this? i want the applet to return a simple byte array along with the status word 9000 (which is default for success), when i send the select command to the card.

也就是说,当我发出以下命令

ie, when i send the following command

00A4040006010203040506

00A4040006010203040506

我希望有一个类似的反应,

i want a response like,

010203049000

010203049000

(前四个字节被从applet返回的数据)
TIA。
在此先感谢..

(first four bytes are the data returned from the applet) TIA. thanks in advance..

推荐答案

我猜你的好习惯,如果selectingApplet(),然后返回过程?您需要处理传入的APDU,而不是简单的回归。

I guess you do the "good practice" of "if selectingApplet() then return" in process? You need to process the incoming APDU instead of simple return.

您可以返回数据,选择正常的方式,但要注意回到0×9000,如果选择是成功的。

You can return data to select the normal way, but be careful to return 0x9000 if the select was successful.

这篇关于是否有可能用在Java卡选择一个小程序状态字9000一起返回一些数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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