Search code examples
appletsmartcardjavacardsmartcard-readerglobalplatform

Installing an applet on a JavaCard


I am trying to install an applet on a JavaCard using GlobalPlatformPro, however keep getting the error code 6985 - conditions of use not satisfied. I have done some research and found that this could mean the card is locked?

Installing an applet is the first thing I tried to do when I got this error so I haven't (at least purposefully) locked it myself.

When listing all the applets on the card my applet is there, but listed as 'LOADED' and not 'SELECTABLE' which I believe it should be.

Is there a way I can inlock the card? Or is this another issue?


Solution

  • Your card is not locked. If the card is locked you cannot list the applets anymore. The mutual authentication would also fail, only "selection of the application with the Final Application privilege." according to GP 2.3.1 is possible.

    If the applet could get loaded but not installed, i.e. the loading succeeded and the package is on the card but the instantiation failed, this means usually that an exception was thrown in the constructor or the install method. Debug your code by removing code until the installation works to find the erroneous code line. It could also be that an applet with the same instance AID is already on the card.