×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Aug 2008
    Posts
    15

    Exclamation problem with jsr 177 (satsa)

    Hi,
    in the wtk2.5 examples is the mohair midlet. i can run it using netbeans emulator and cref.
    but in real testing in deviceanywhere.com and also in a real device the midlet installs but does not do anything.
    what is the problem?

  2. #2
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Thumbs up Re: problem with jsr 177 (satsa)

    Quote Originally Posted by mhssamadani View Post
    Hi,
    in the wtk2.5 examples is the mohair midlet. i can run it using netbeans emulator and cref.
    but in real testing in deviceanywhere.com and also in a real device the midlet installs but does not do anything.
    what is the problem?
    Hi,
    Welcome to the Forum Nokia Discussion board.
    Please try to use the words,understandable..

    1.Which device you are working with?
    2.When you starting the midlet from the device application listing,what exactly is happening?
    is device showing any message...or what?
    3.What exactly your application is doing at the staring of the application..
    what you are doing in the constructor/startApp ?
    4.Can you test any other demo application on the same device?
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Nokia Developer Champion
    Join Date
    Sep 2008
    Location
    Noida, U.P.
    Posts
    1,330

    Thumbs up Re: problem with jsr 177 (satsa)

    Quote Originally Posted by mhssamadani View Post
    Hi,
    in the wtk2.5 examples is the mohair midlet. i can run it using netbeans emulator and cref.
    but in real testing in deviceanywhere.com and also in a real device the midlet installs but does not do anything.
    what is the problem?
    check the API compatibility of device which u r taken for testing. Explain about the device which u r taken for testing..
    thanks,
    jitu_goldie..

    KEEP TRYING..

  4. #4
    Registered User
    Join Date
    Aug 2008
    Posts
    15

    Re: problem with jsr 177 (satsa)

    1.the midlet is tested with the emulator and it works.
    2.i am using a nokia 5800mx.also i tried many devices like N96 and E71 in the www.deviceanywhere.com .
    3.the midlet installs without any problem, when i click on the midlet icon the menu items, find slots and pki sign text, are appearing. but now when i click on the items nothing is happening, and nothing changes.there is no message, warning or error. the midlet is remaining on the menu items .
    the code is here:

    public void startApp() {
    if (mDisplay == null) {
    mDisplay = Display.getDisplay(this);
    }

    if (mMenu == null) {
    mMenu = new List("MohairMIDlet", List.IMPLICIT);
    mMenu.append(kQuerySlots, null);
    mMenu.append(kSignTest, null);

    mBackCommand = new Command("Back", Command.BACK, 0);
    mExitCommand = new Command("Exit", Command.EXIT, 0);

    mMenu.addCommand(mExitCommand);
    mMenu.setCommandListener(this);
    }

    mDisplay.setCurrent(mMenu);
    }
    public void commandAction(Command c, Displayable d) {
    if (c == mExitCommand) {
    destroyApp(true);
    notifyDestroyed();
    } else if ((c == List.SELECT_COMMAND) && (d == mMenu)) {
    int selection = mMenu.getSelectedIndex();
    String item = "[none]";

    if ((selection >= 0) && (selection < mMenu.size())) {
    item = mMenu.getString(selection);
    }

    if (item == kQuerySlots) {
    Form slotList = new Form("Slots");
    String slots = System.getProperty("microedition.smartcardslots");
    int index = 0;

    while (index < slots.length()) {
    String slot;
    int comma = slots.indexOf(',', index);

    if (comma == -1) {
    slot = slots.substring(index).trim();
    index = slots.length();
    } else {
    slot = slots.substring(index, comma).trim();
    index = comma + 1;
    }

    StringItem slotItem = new StringItem(null, slot);
    slotItem.setLayout(Item.LAYOUT_2 | Item.LAYOUT_NEWLINE_AFTER);
    slotList.append(slotItem);
    }

    slotList.addCommand(mBackCommand);
    slotList.setCommandListener(this);
    mDisplay.setCurrent(slotList);
    } else if (item == kSignTest) {
    System.out.println("Starting sign test...");

    new Thread() {
    public void run() {
    fromSpecification();
    System.out.println("Sign test finished.");
    }
    }.start();
    }
    } else if (c == mBackCommand) {
    mDisplay.setCurrent(mMenu);
    }
    }
    private void fromSpecification() {
    String[] caNames = null; //midlet searches for certificates
    String stringToSign = new String("JSR 177 Approved");
    String userPrompt =
    new String("Please insert the security element " + "issued by bank ABC" +
    "for the application XYZ.");
    byte[] byteArrayToSign = new byte[8];
    byte[] authSignature;
    byte[] signSignature;

    try {
    authSignature = CMSMessageSignatureService.authenticate(byteArrayToSign,
    CMSMessageSignatureService.SIG_INCLUDE_CERTIFICATE |
    CMSMessageSignatureService.SIG_INCLUDE_CONTENT, caNames, userPrompt);

    signSignature = CMSMessageSignatureService.sign(stringToSign,
    CMSMessageSignatureService.SIG_INCLUDE_CERTIFICATE |
    CMSMessageSignatureService.SIG_INCLUDE_CONTENT, caNames, userPrompt);
    } catch (IllegalArgumentException iae) {
    // Perform error handling
    iae.printStackTrace();
    } catch (CMSMessageSignatureServiceException ce) {
    if (ce.getReason() == ce.CRYPTO_FORMAT_ERROR) {
    System.out.println("Error formatting signature.");
    } else {
    System.out.println(ce.getMessage());
    }
    } catch (Exception e) {
    System.out.println("Other exception: " + e);
    }
    }

  5. #5
    Registered User
    Join Date
    Feb 2008
    Posts
    6

    Re: problem with jsr 177 (satsa)

    In Device, the the support for Satsa-APDU package is not yet in if that is S60 phone. So you could not search for smart card slots.
    Also do you have a proper SIM card with some certificates in it? It is not must if you addyourself. Is that SIM card WIM enabled?

    Br,
    Somabho

  6. #6
    Registered User
    Join Date
    Aug 2008
    Posts
    15

    Re: problem with jsr 177 (satsa)

    i am agree with you about that, but if the problem is that why no error message appears.
    in the emulator when the cref is not running the emulator shows the exception and request from the user to insert a sim card containing a proper certificate.

  7. #7
    Registered User
    Join Date
    Feb 2008
    Posts
    6

    Re: problem with jsr 177 (satsa)

    Hi,

    When cref is not running, the behaviour is as expected. I do not know abt cref. That may be masking the exceptions.
    Also after the call to System.getproperty(), pls check whether "slot" returned against NULL. If slot is NULL, then there is no point going forward. But in your code it seems that you are not checking this.

    Br,
    Somabho

Similar Threads

  1. SyncML link problem
    By samuel_ in forum Symbian C++
    Replies: 4
    Last Post: 2009-03-27, 08:02
  2. E61, CDC & JSR 179
    By jdesjean in forum Mobile Java Tools & SDKs
    Replies: 2
    Last Post: 2007-06-27, 13:41
  3. 6230 and JSR 82 problem
    By Robert111 in forum Bluetooth Technology
    Replies: 8
    Last Post: 2006-04-28, 20:32
  4. 6230 and JSR 82 problem
    By Robert111 in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2004-11-11, 10:02
  5. 6230 and JSR 82 problem
    By Robert111 in forum Mobile Java General
    Replies: 2
    Last Post: 2004-11-02, 13:39

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •