Page 1 of 1

Questions about shareable interface between two javacard applets

Posted: Tue Sep 15, 2015 4:48 am
by Bodewes
I want to call the commethod() of the second applet in the process() method of my first 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?

Re: Questions about shareable interface between two javacard applets

Posted: Mon Nov 02, 2015 8:39 am
by predators
I see there is a vedio "http://javacardos.com/javacardforum/viewtopic.php?f=31&t=86" about how to import another package, you can view it.
I feel it's very good, and will help to you.