question about shareinterface in java card
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   david_ke
Posted On:   Friday, January 3, 2003 01:00 AM

Now I try to develop a loyalty and a purse with jcop 20 . I use the share interface to share data between two applets.At first I write two small applets to test the share interface.Then I manully dowon the two applets into the card but it doesn't work. The error always happen to the "getAppletShareableInterfaceObject" method.Following is part of the code. //.............................................. buffer[0]=(byte)0x06; buffer[1]=(byte)0x05; buffer[2]=(byte)0x04; buffer[3]=(byte)0x03; buffer[4]=(byte)0x02; buffer[5]=(byte)0x01; buffer[6]=(byte)0x01; //server applet ID AID loyaltyAID2 = JCSystem.lookupAID(buffer, (short) 0,(byte)7); if(loy   More>>

Now I try to develop a loyalty and a purse with jcop 20 .
I use the share interface to share data between two applets.At first I write two small applets to test the share interface.Then I manully dowon the two applets into the card but it doesn't work.

The error always happen to the "getAppletShareableInterfaceObject" method.Following is part of the code.

//..............................................
buffer[0]=(byte)0x06;
buffer[1]=(byte)0x05;
buffer[2]=(byte)0x04;
buffer[3]=(byte)0x03;
buffer[4]=(byte)0x02;
buffer[5]=(byte)0x01;
buffer[6]=(byte)0x01; //server applet ID

AID loyaltyAID2 = JCSystem.lookupAID(buffer, (short) 0,(byte)7);
if(loyaltyAID2==null) ISOException.throwIt((short)0x0902);

loyaltySIO = (JavaLoyaltyInterface) JCSystem.getAppletShareableInterfaceObject(loyaltyAID2,(byte)0);
//...........................................

I try to find the error I find the error so I trace to the server applet,I add a "ISOException.throwIt " method in the
getShareableInterfaceObject.I find if I add it,the "getAppletShareableInterfaceObject" will return but get the null object.
It's correct.But when I remark the "ISOException.throwIt" and just return "this" ,the card will get "6F00".Following is my code.


//....................................
public Shareable getShareableInterfaceObject(AID clientAID,byte parameter)
{
//ISOException.throwIt((short)0x9999);
return this;
}
//............................
Could you show me what happen ?


best regards,

David

   <<Less

Re: question about shareinterface in java card

Posted By:   Damien_Sauveron  
Posted On:   Tuesday, January 14, 2003 03:24 PM

If I understood well your question, here is my answer.


1) When you have the code

public Shareable getShareableInterfaceObject(AID clientAID, byte parameter) {
ISOException.throwIt((short)0x9999);
return this;
}

Does the card return 0x9999 ? If yes, you access to the applet server and skip at 2). If not, verify the AIDof the server. If it is good, that can be a bug in the implementation of JCOP20, but i don't think.


2) Are you sure that your applet server implements JavaLoyaltyInterface ? (applet with AID 06050403020101)
And are you sure the JavaLoyaltyInterface extends the Shareable interface ?


3) Are you sure that the exception is not throws after the return of the JCSystem.getAppletShareableInterfaceObject ? Use also ISOException.throwIt to confirm this option.


SW 6F00 is the result of an unknown exception but on test card often security exception are map on this SW in order not to give information to an attacker or don't mark this event in the security log.


hope this helps,


Damien Sauveron
About | Sitemap | Contact