Our Online Store have the new products: RFID antenna board. Currently it can work with JC10M24R and JCOP4 card chips.
Compared with normal cards, the antenna board module has a smaller size and fixed holes, which is easy to integrate in the IOT(Internet Of Things) project.

NULL procedure byte 0x60

JavaCard Applet Development Related Questions and Answers.
sam786
Posts: 5
Joined: Mon Sep 28, 2020 10:25 am
Points :112
Contact:

NULL procedure byte 0x60

Post by sam786 » Thu Dec 24, 2020 9:10 am

Hi guys

I’m really hoping someone could help me out here as I’ve been trying to figure this out last few days now...

I am trying to issue a Null procedure byte 0x60 requesting for additional work time.

I am really unsure how to implement this function in my code.

A sample code with some simple explanation in layman's terms would be greatly appreciated as im new to javacard!

Thanks in advance!!!

kuafu
Posts: 317
Joined: Thu Jun 25, 2015 2:09 am
Points :4551
Contact:

Re: NULL procedure byte 0x60

Post by kuafu » Sat Dec 26, 2020 6:19 am

What is NULL procedure byte 0x60?
well

sam786
Posts: 5
Joined: Mon Sep 28, 2020 10:25 am
Points :112
Contact:

Re: NULL procedure byte 0x60

Post by sam786 » Sat Dec 26, 2020 7:52 am

Hi kuafu,

Thank you again for offering to help out!!!

I will try to make this as short as possible.

As per ISO7816-3 (10.3.3)
After transmitting the header as a string of five characters (C-APDU), the interface device shall wait for a character conveying a procedure byte (R-APDU). There are three types of procedure bytes: NULL, SW1, ACK.

NULL: 0x60

SW1, SW2: (Example: 9000 - command normally completed etc...)

ACK:

If the value is '60', it is a NULL byte. It requests no action on data transfer. The interface device shall wait for a character conveying a procedure byte.
At each procedure byte, the card can proceed with the command by NULL or ACK, or finish the command by SW1 SW2, or show its disapproval by becoming unresponsive (WT will be exceeded).

I am trying to respond to a Generate Application cryptogram request:

80 AE 80 00 1D (CLA, INS, P1, P2, P3)

I would like the card to respond with a NULL byte 0x60 to request the interface device for more time.

If I write the following code:

ISOException.throwIt((short) 0x60);

The interface device will throw an error and disconnect the communication with the card as 0x60 is not an SW1 byte (as defined by ISO7816-3)

If I write the following code:

{

(byte) 0x60

};

short len = (short) sendbyte.length;
Util.arrayCopyNonAtomic(sendbyte, (short)0, buffer, (short)0, (short)len);
apdu.setOutgoing();
apdu.setOutgoingLength(len);
apdu.sendBytes((short) 0, (short)len);

The card will respond with the following data: 60 90 00, this is also incorrect parameters (as defined by ISO7816-3).

Someone has asked a similar question in another post:

https://javacardos.com/javacardforum/vi ... +byte#p231

The reply in that post stated:

public static void waitExtension() throws APDUException
Note:
1-In T=0 protocol, a NULL procedure byte is sent to reset the work waiting time.
2-In T=1 protocol, the implementation needs to request the same T=0 protocol work waiting time quantum by sending a T=1 protocol request for wait time extension.

is this related to me? if so how can i implement this function in my code?

A sample code would be greatly appreciated!!!

Thanks in advance!!!!!!!!!!!!!!!!

kuafu
Posts: 317
Joined: Thu Jun 25, 2015 2:09 am
Points :4551
Contact:

Re: NULL procedure byte 0x60

Post by kuafu » Sun Dec 27, 2020 3:50 am

sam786 wrote:
Sat Dec 26, 2020 7:52 am
Hi kuafu,

Thank you again for offering to help out!!!

I will try to make this as short as possible.

As per ISO7816-3 (10.3.3)
After transmitting the header as a string of five characters (C-APDU), the interface device shall wait for a character conveying a procedure byte (R-APDU). There are three types of procedure bytes: NULL, SW1, ACK.

NULL: 0x60

SW1, SW2: (Example: 9000 - command normally completed etc...)

ACK:

If the value is '60', it is a NULL byte. It requests no action on data transfer. The interface device shall wait for a character conveying a procedure byte.
At each procedure byte, the card can proceed with the command by NULL or ACK, or finish the command by SW1 SW2, or show its disapproval by becoming unresponsive (WT will be exceeded).

I am trying to respond to a Generate Application cryptogram request:

80 AE 80 00 1D (CLA, INS, P1, P2, P3)

I would like the card to respond with a NULL byte 0x60 to request the interface device for more time.

If I write the following code:

ISOException.throwIt((short) 0x60);

The interface device will throw an error and disconnect the communication with the card as 0x60 is not an SW1 byte (as defined by ISO7816-3)

If I write the following code:

{

(byte) 0x60

};

short len = (short) sendbyte.length;
Util.arrayCopyNonAtomic(sendbyte, (short)0, buffer, (short)0, (short)len);
apdu.setOutgoing();
apdu.setOutgoingLength(len);
apdu.sendBytes((short) 0, (short)len);

The card will respond with the following data: 60 90 00, this is also incorrect parameters (as defined by ISO7816-3).

Someone has asked a similar question in another post:

https://javacardos.com/javacardforum/vi ... +byte#p231

The reply in that post stated:

public static void waitExtension() throws APDUException
Note:
1-In T=0 protocol, a NULL procedure byte is sent to reset the work waiting time.
2-In T=1 protocol, the implementation needs to request the same T=0 protocol work waiting time quantum by sending a T=1 protocol request for wait time extension.

is this related to me? if so how can i implement this function in my code?

A sample code would be greatly appreciated!!!

Thanks in advance!!!!!!!!!!!!!!!!
https://www.javacardos.com/wiki/javacar ... textension
But it depends on whether the virtual machine is supported it.Most of the time this waitextension is not implemented .
And or

Code: Select all

ISOException.throwIt((short) 0x60);   
or
{ 


(byte) 0x60

		};
			  
      short len = (short) sendbyte.length;
      Util.arrayCopyNonAtomic(sendbyte, (short)0, buffer, (short)0, (short)len);    
      apdu.setOutgoing();
      apdu.setOutgoingLength(len);
      apdu.sendBytes((short) 0, (short)len);
      
They didn't work. You can't reach your destination by send any data back in applet level.
well

kuafu
Posts: 317
Joined: Thu Jun 25, 2015 2:09 am
Points :4551
Contact:

Re: NULL procedure byte 0x60

Post by kuafu » Sun Dec 27, 2020 3:56 am

sam786 wrote:
Thu Dec 24, 2020 9:10 am
Hi guys

I’m really hoping someone could help me out here as I’ve been trying to figure this out last few days now...

I am trying to issue a Null procedure byte 0x60 requesting for additional work time.

I am really unsure how to implement this function in my code.

A sample code with some simple explanation in layman's terms would be greatly appreciated as im new to javacard!

Thanks in advance!!!
In a word . It's the duty of java card virtual machine. You can not do that on applet level.
well

sam786
Posts: 5
Joined: Mon Sep 28, 2020 10:25 am
Points :112
Contact:

Re: NULL procedure byte 0x60

Post by sam786 » Tue Jan 26, 2021 11:40 am

Thanks kuafu,

As always really appreciate the help and support!!!!!!!!!!!!

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 57 guests

JavaCard OS : Disclaimer