我写了一个代码,为Java卡2.2.1和我测试它的JCIDE。 我得到错误在方法Setoutgoinglength()未知的错误(6c 15)与Java卡中的Setoutgoinglength 2.2.1
public void getoutput(APDU apdu)
{
byte [] buffer = apdu.getBuffer();
byte hello[] = {'H','E','L','L','O',' ','W','O','R','L','D',' ', 'J','A','V','A',' ','C','A','R','D'};
short le = apdu.setOutgoing();
short totalBytes = (short) hello.length;
Util.arrayCopyNonAtomic(hello, (short)0, buffer, (short)0, (short)totalBytes);
apdu.setOutgoingLength(totalBytes);
apdu.sendBytes((short) 0, (short) hello.length);}
您可以发送您发送的APDU吗? – Chooch
谢谢你的回答。我发送“00 40 00 00 00”我的ins = 40和lc = 00 –
谢谢。顺便说一句,我只想指出APDU中的最后一个字节被认为是Le而不是Lc。 Lc仅在命令数据字段存在时才存在。否则,第五个字节将被视为Le。 – Chooch