简体   繁体   English

T = 1智能卡协议

[英]T=1 smart card protocol

I have question related to T= 1 Smart Card communication protocol. 我有关于T = 1智能卡通信协议的问题。 Let's say terminal sends I-block with expected Ne data to be returned from the card (so called case 2S) and card has less data to send. 假设终端发送的I-block带有预期的Ne数据将从卡中返回(所谓的情况2S),而卡中要发送的数据较少。 Does it mean that terminal should wait until timeout and then inspect whatever received for last two bytes (which should be SW1 and SW2 statuses) ? 这是否意味着终端应等待超时,然后检查最后两个字节(应该是SW1和SW2状态)接收到的内容? Or is there some other scenario related to that issue ? 还是有其他与该问题有关的情况? With T= 0 protocol that issue is addressed by procedure byte, however in T= 1 I only see the above way. 对于T = 0协议,该问题由过程字节解决,但是在T = 1中,我仅看到上述方式。

Thanks 谢谢

guidot maybe claims that he's not an expert, but I would not believe him. 吉多特可能声称他不是专家,但我不相信他。

The Ne value (encoded using Le) indeed only indicates a maximum number of bytes to be returned. Ne值(使用Le编码)实际上仅指示要返回的最大字节数。 You might just have a buffer size of a particular maximum or have overhead (secure messaging) that prohibits using higher values. 您可能只是具有特定最大值的缓冲区大小,或者具有禁止使用更高值的开销(安全消息传递)。 You may however have APDU commands where Ne is used to indicate the amount of bytes that should be sent if available, such as READ BINARY. 但是,您可能具有APDU命令,其中Ne用于指示应发送的字节数(如果可用),例如READ BINARY。

The size of the (response) APDU is determined by the underlying datalink layer (the chaining bit and LEN bytes used in the blocks within the frames). (响应)APDU的大小由基础数据链路层(在帧内的块中使用的链接位和LEN字节)确定。 T=1 is not a byte oriented protocol such as T=0. T = 1不是面向字节的协议,例如T = 0。 For T=1 and indeed T=CL the datalink layer determines the size of the command and response APDU, not the application layer with the Nc and Ne bytes. 对于T = 1且实际上为T = CL,数据链路层确定命令和响应APDU的大小,而不是具有Nc和Ne字节的应用层。

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

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