在 javacard 中选择小程序时,是否可以返回一些数据以及状态字 9000? [英] is it possible to return some data along with the status word 9000 on selecting an applet in javacard?

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

问题描述

我想知道我是否可以在选择 javacard 小程序时发回一些数据.

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(这是成功的默认值).

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

我想要这样的回复,

010203049000

010203049000

(前四个字节是小程序返回的数据)TIA.提前致谢..

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

推荐答案

我猜你在处理if selectionApplet() then return"的良好实践"吗?您需要处理传入的 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.

可以正常方式返回数据选择,但注意选择成功返回0x9000.

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

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

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