1 Reply Latest reply: Nov 9, 2010 5:19 AM by 811668 RSS

    JSR177  - APDUConnection SecurityException

    671482
      Hello,

      I am using the JSR-177 in a JavaME Midlet that is responsible of communicating with a Javacard cardlet, loaded on a SIM card. I use the class APDUConnection to select my cardlet, and send APDU commands.

      It works fine when I simulate the Midlet and Cardlet (I work in Netbeans). But when I load my cardlet onto a real SIM card, and when I test the MIDlet (on a phone or in the simulator), I cannot send APDU commands. I can successfully connect to my cardlet (with Connector.open(cardletURL) ), but when I try to send APDU commands with the exchangeAPDU(...) method, I get the following exception:

      java.lang.SecurityException: Access denied
      at com.sun.satsa.acl.APDUPermissions.checkPermission(), bci=24
      at com.sun.cdc.io.j2me.apdu.Protocol.exchangeAPDU(), bci=190
      ...

      Does anyone know what the problem can be?
      I have read things about:
      - Signing the MIDlet
      - Access Control Files
      but I can't find a solution.

      I hope someone could help me. Thank you.

      Julien
        • 1. Re: JSR177  - APDUConnection SecurityException
          811668
          Hi,

          I am trying to do what you have done but I must be doing something wrong. I want to connect my Cardlet and Midlet applications but it fails. What I am doing is to launch my Cardlet and then the Midlet.

          The script I am using for the Cardlet it is like this:

          //Test script for Applet 'Cardlet'

          powerup;
          0x00 0xA4 0x04 0x00 0X06 0X24 0X45 0X0A 0XE1 0X8C 0XDC 0x7F;

          I assume that without the powerdown the cardlet should keep working until I close it explicitly.

          Once the cardlet is loaded I try to connect to it using the next command in my midlet:
          String purseURL = "apdu:0;target=24.45.0A.E1.8C.DC";

          try {
          purseConnection = (APDUConnection)Connector.open(purseURL);


          Do you know what I am doing wrong??


          Thanks in advance.