Get Response 6F00
Posted: Thu Sep 01, 2016 11:44 pm
I wrote an applet, The followings are part of the code. When I sent my command to the card, it can return the data successfully. But about 50 times, it returned "6F00". What happened? How can I solve this problem?
Code: Select all
//Get data from APDU, generate random code, encrypt the data and then send it.
private void apro(APDU apdu) {
byte[] buffer = apdu.getBuffer();
byte[] random=new byte[4];
gen_random(random);
byte[] data=new byte[8];
data[0]=random[0];
data[1]=(byte)0x88;
data[2]=(byte)0x32;
data[3]=(byte)0x86;
data[4]=(byte)0x80;
data[5]=random[1];
data[6]=random[2];
data[7]=random[3];
byte[] data2=encryptdata(data,keydata,(byte)0);
Util.arrayCopyNonAtomic(data2, (short)0, buffer, (short)0, (short) 8);
apdu.setOutgoingAndSend((short)0, (short)8);