Questions about shareable interface between two javacard applets
Posted: Tue Sep 15, 2015 4:48 am
I want to call the commethod() of the second applet in the process() method of my first applet.
For example,
the first applet:
the second applet
And I know that I need to implement Shareable interface.
My Qs:
1-The two applets are in two different packages. Should I implement it in each package?
2- If I implement Shareable, any other applet is also able to access this applet, isn't it? If so, how can i make this method only available for one applet?
For example,
the first applet:
Code: Select all
package first;
public class firstapp extends Applet {
private firstapp()
{
}
public static void install(byte bArray[], short bOffset, byte bLength)
{
new firstapp().register();
}
public void process(APDU apdu)
{
if(selectingApplet())
{
return;
}
byte[] buf = apdu.getBuffer();
//call commethod() of the second applet
}
}
the second applet
Code: Select all
package second;
public class secondapp extends Applet {
private secondapp()
{
}
public static void install(byte bArray[], short bOffset, byte bLength)
{
new secondapp().register();
}
public void process(APDU apdu)
{
}
public void commethod()
{
ISOException.throwIt((short)0x6901);
}
}
And I know that I need to implement Shareable interface.
My Qs:
1-The two applets are in two different packages. Should I implement it in each package?
2- If I implement Shareable, any other applet is also able to access this applet, isn't it? If so, how can i make this method only available for one applet?