Page 1 of 1

How to use APDU instance in install method

Posted: Sun Jun 18, 2017 10:31 pm
by leogen
I want to use

Code: Select all

OPSystem.getCPLCData(javacard.framework.APDU apdu, short apdu_offset, short cplc_offset, short length) 


in install() method. But APDU is not accessible in install method.

Here is my code:

Code: Select all

public static void install(bytes[] bArray, short bOffset, byte bLength){

short apdu_offset = (short)0;
short cplc_offset = (short)8;
short length = (short)2;

OPSystem.getCPLCData(apdu, apdu_offset, cplc_offset length);

}


Does anybody know where I did wrong? Pls help to solve this. Thanks

Re: How to use APDU instance in install method

Posted: Mon Jun 19, 2017 2:01 am
by chico0609
Because the byte[] in the install method is the global buffer. You will need to defer this call until the process method has been invoked.

Re: How to use APDU instance in install method

Posted: Mon Jun 19, 2017 4:27 am
by leogen
Is there any way to get CPLC information in install() method?

Re: How to use APDU instance in install method

Posted: Mon Jun 19, 2017 6:12 am
by chico0609
It's a little hard to reach your goal. Why do you need it in the install method?