6C 0B - Unknown Error ( DEBUG )
Posted: Thu Dec 08, 2016 3:29 pm
Hello everyone,
I am having the following error when debugging: 6C 0B
But the INS is: (byte) 0x00;
I understand that the APDU is:
CLS | INS | P1 | P2 | LC | LE
CLS: 80
INS: 00
P1: 00
P2: 00
// debug JCIDE IDE :
>> /select 010203040506070809070707 <-- AID
>> 00 A4 04 00 0C 01 02 03 04 05 06 07 08 09 07 07 07 00
<< 90 00 <-- OK
>> /send 80000000
>> 80 00 00 00
<< 6C 0B Unknown Error <-- error
Here is my source ...
package br.com.helloworld;
import javacard.framework.*;
public class HelloWorldJC extends javacard.framework.Applet {
// CLA Byte
final static byte HELLO_CLA = (byte) 0x80;
private static final byte[] helloWorld = { (byte) 'H', (byte) 'e',
(byte) 'l', (byte) 'l', (byte) 'o', (byte) ' ', (byte) 'W',
(byte) 'o', (byte) 'r', (byte) 'l', (byte) 'd', };
private static final byte INS_HELLO = (byte) 0x00;
public static void install(byte[] bArray, short bOffset, byte bLength) {
(new HelloWorldJC()).register(
bArray,
(short) (bOffset + 1),
bArray[bOffset]);
}
public void process(APDU apdu) {
byte[] buffer = apdu.getBuffer();
if ((buffer[ISO7816.OFFSET_CLA] == 0)
&& (buffer[ISO7816.OFFSET_INS] == (byte) (0xA4)))
return;
if (buffer[ISO7816.OFFSET_CLA] != HELLO_CLA)
ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);
switch (buffer[ISO7816.OFFSET_INS]) {
case INS_HELLO :
getHello(apdu);
return;
default :
ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
}
}
private void getHello(APDU apdu) {
short le = apdu.setOutgoing();
short totalBytes = (short) helloWorld.length;
apdu.setOutgoingLength(totalBytes);
apdu.sendBytesLong(helloWorld, (short) 0, (short) helloWorld.length);
}
}
I am having the following error when debugging: 6C 0B
But the INS is: (byte) 0x00;
I understand that the APDU is:
CLS | INS | P1 | P2 | LC | LE
CLS: 80
INS: 00
P1: 00
P2: 00
// debug JCIDE IDE :
>> /select 010203040506070809070707 <-- AID
>> 00 A4 04 00 0C 01 02 03 04 05 06 07 08 09 07 07 07 00
<< 90 00 <-- OK
>> /send 80000000
>> 80 00 00 00
<< 6C 0B Unknown Error <-- error
Here is my source ...
package br.com.helloworld;
import javacard.framework.*;
public class HelloWorldJC extends javacard.framework.Applet {
// CLA Byte
final static byte HELLO_CLA = (byte) 0x80;
private static final byte[] helloWorld = { (byte) 'H', (byte) 'e',
(byte) 'l', (byte) 'l', (byte) 'o', (byte) ' ', (byte) 'W',
(byte) 'o', (byte) 'r', (byte) 'l', (byte) 'd', };
private static final byte INS_HELLO = (byte) 0x00;
public static void install(byte[] bArray, short bOffset, byte bLength) {
(new HelloWorldJC()).register(
bArray,
(short) (bOffset + 1),
bArray[bOffset]);
}
public void process(APDU apdu) {
byte[] buffer = apdu.getBuffer();
if ((buffer[ISO7816.OFFSET_CLA] == 0)
&& (buffer[ISO7816.OFFSET_INS] == (byte) (0xA4)))
return;
if (buffer[ISO7816.OFFSET_CLA] != HELLO_CLA)
ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);
switch (buffer[ISO7816.OFFSET_INS]) {
case INS_HELLO :
getHello(apdu);
return;
default :
ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
}
}
private void getHello(APDU apdu) {
short le = apdu.setOutgoing();
short totalBytes = (short) helloWorld.length;
apdu.setOutgoingLength(totalBytes);
apdu.sendBytesLong(helloWorld, (short) 0, (short) helloWorld.length);
}
}