主机卡仿真中的最大 APDU 大小.可以更长吗? [英] Maximum APDU size in host card emulation. Can it be longer?

查看:69
本文介绍了主机卡仿真中的最大 APDU 大小.可以更长吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将数据从主机卡模拟模式下的安卓手机发送到读卡器应用程序.我知道 apdu 的最大大小应该是大约 260 字节.但是我需要发送远远超出这个范围(几千字节).我知道我可以将数据分割并以块"的形式发送,但我真的很担心在一般性能上的成本.无论如何我可以发送大于 260 字节的 apdu.如果必须的话,我也不介意做点小事.干杯

I am trying to send data from an android phone in Host card emulation mode to a reader application. I do understand the maximum size of an apdu should be about 260bytes. However I need to send well beyond that (a few thousand bytes). I know I can divide the data and send it in "chunks", but I am really worried about cost of that on the general performance.Is there anyway I can send a bigger apdu than 260 bytes. I don't mind a little hack too if I have to. Cheers

推荐答案

回答我自己的问题.根据它们容纳的最大数据大小,有两种类型的 APDU.正常大小的 APDU(256 字节)和扩展 APDU,有效载荷高达 65536 字节.然而,并非所有智能卡和读卡器都支持扩展的 APDU 长度.

To answer my own question. There are 2 types of APDUs according to the maximum size of data they accommodate. Normal sized APDUs (256 bytes) and extended APDUs with payload of upto 65536 bytes. However not all smartcards and readers support the extended APDU length.

现在在 Android 方面,Android 操作系统不支持扩展长度的 APDU.尽管大多数 NFC 控制器都支持它.因此,这是一种软件限制,而不是硬件限制.见中的 getMaxTransceiveLength 方法https://android.googlesource.com/platform/packages/apps/Nfc/+/master/nci/src/com/android/nfc/dhimpl/NativeNfcManager

Now on the android side of things, the extended length APDUs is not supported by the Android OS. Even though most of the NFC controllers support it. Therefore this is a software limitation and not a hardware one. See the getMaxTransceiveLength method in https://android.googlesource.com/platform/packages/apps/Nfc/+/master/nci/src/com/android/nfc/dhimpl/NativeNfcManager

这篇关于主机卡仿真中的最大 APDU 大小.可以更长吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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