JavacardOS will not accept order any more, please contact our partner Feitian online Store:
https://ftsafe.en.alibaba.com/index.html
https://ftsafe.en.alibaba.com/index.html
6C 0B - Unknown Error ( DEBUG )
6C 0B - Unknown Error ( DEBUG )
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);
}
}
Re: 6C 0B - Unknown Error ( DEBUG )
Hi,
I Solved the problem :
short readCount = apdu.setIncomingAndReceive();
[b] Util.arrayCopyNonAtomic(helloWorld,(byte)0,buffer,ISO7816.OFFSET_CDATA,(short)helloWorld.length);[/b]
apdu.setOutgoingAndSend(ISO7816.OFFSET_CDATA,(short)helloWorld.length);
break;
Thanks !
I Solved the problem :
short readCount = apdu.setIncomingAndReceive();
[b] Util.arrayCopyNonAtomic(helloWorld,(byte)0,buffer,ISO7816.OFFSET_CDATA,(short)helloWorld.length);[/b]
apdu.setOutgoingAndSend(ISO7816.OFFSET_CDATA,(short)helloWorld.length);
break;
Thanks !
- UNKNwYSHSA
- Posts: 630
- Joined: Thu May 21, 2015 4:05 am
- Points :3053
- Contact:
Re: 6C 0B - Unknown Error ( DEBUG )
Send the command with LE as 0x0B;
SW = 0x6Cxx
Means that the command shall be sent with LE = xx.
Code: Select all
/send 800000000B
SW = 0x6Cxx
Means that the command shall be sent with LE = xx.
sense and simplicity
Re: 6C 0B - Unknown Error ( DEBUG )
Hi, UNKNwYSHSA
Thanks !
Thanks !
- UNKNwYSHSA
- Posts: 630
- Joined: Thu May 21, 2015 4:05 am
- Points :3053
- Contact:
Re: 6C 0B - Unknown Error ( DEBUG )
sense and simplicity
Re: 6C 0B - Unknown Error ( DEBUG )
Please use the Code tag for your APDU request/response and codes to make it easier for forum members to read.
Thanks.
Thanks.
Re: 6C 0B - Unknown Error ( DEBUG )
Hi,
Ok, sorry !
Ok, sorry !
Who is online
Users browsing this forum: No registered users and 14 guests