personalisation
personalisation
Hello sir,
How i can check whether the my applet is personalized or not...?
Regards,
Thammineni Naresh.
How i can check whether the my applet is personalized or not...?
Regards,
Thammineni Naresh.
Re: personalisation
Code: Select all
package PA ;
import javacard.framework.*;
public class few extends Applet
{
public static void install(byte[] bArray, short bOffset, byte bLength)
{
new few().register(bArray, (short) (bOffset + 1), bArray[bOffset]);
}
few(){
personalized = false;
}
public boolean personalized ;
void process_personalized(){
// check whether the my applet is personalized or not
if(personalized){
ISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);
}
// do personalized stuff
// ....
// set personalized true;
personalized = true;
}
public void process(APDU apdu)
{
if (selectingApplet())
{
return;
}
byte[] buf = apdu.getBuffer();
switch (buf[ISO7816.OFFSET_INS])
{
case (byte)0x00:
process_personalized();
break;
default:
ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
}
}
}
well
Who is online
Users browsing this forum: No registered users and 30 guests