×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jul 2010
    Posts
    7

    Security exception on reading Embedded UID

    Hi,
    Im using Series 40 Nokia 6212 emulator and I was able to read Embedded UID sometime back using the below code....
    Code:
    	protected void startApp() throws MIDletStateChangeException {
    		Display.getDisplay(this).setCurrent(form);
     
    		MFStandardConnection myTag = null;
    		try 
    		{
    			System.out.println("Start application\n");
    			myTag = (MFStandardConnection) Connector.open(System.getProperty("internal.mf.url"));
    			System.out.println("Connection opened\n");
    			form.append("My UID: " + decodeUID(myTag.getManufacturerBlock().getUID()));
    		}
    		catch (Exception e) 
    		{
    			System.out.println("Connection failed\n");
    			form.append(e.toString());
    		} 
    		finally 
    		{
    			if (myTag != null) 
    			{
    				try 
    				{
    					myTag.close();
    				}
    				catch (IOException e) 
    				{
    					form.append(e.toString());
    				}
    			}
    		}
    	}
    The above code was working fine... After some days when I checked suddenly its giving java.lang.SecurityException... Absolutely there is no change in the code.. Im new to this J2ME.. Please let me know what might be the problem...

    Thanks in Advance

    With Regards
    Harsha

  2. #2
    Registered User
    Join Date
    Feb 2009
    Location
    Hagenberg, Austria
    Posts
    121

    Re: Security exception on reading Embedded UID

    Hallo Harsha,

    accessing the secure element/MIFARE area, i.e.
    Code:
    Connector.open(System.getProperty("internal.mf.url"))
    and
    Code:
    Connector.open(System.getProperty("internal.se.url"))
    requires the MIDlet to be trusted by the phone.

    On a real phone (Nokia 6131 NFC and Nokia 6212) the only way to get your application trusted is by signing it with a valid Java code signing certificate. This can be bought for instance from Thawte.

    On the emulator you can bypass this limitiation by changing the trust level in the emulator's settings. In the emulator window select the menu Tools -> Preferences... On the MIDP tab there is a setting called "Security domain". If you set this value to either "trusted" or "maximum" your application should work again.

    br,
    Michael

  3. #3
    Registered User
    Join Date
    Jul 2010
    Posts
    7

    Re: Security exception on reading Embedded UID

    Hi,

    Thank you very much... Its working now... I changed Security domain setting to "Maximum"...

    With regards,
    Harsha

Similar Threads

  1. Security Exception
    By HasithaRandika in forum Mobile Java Networking & Messaging & Security
    Replies: 6
    Last Post: 2012-05-04, 20:40
  2. Security exception when trying to use OBEX
    By leg0 in forum Bluetooth Technology
    Replies: 0
    Last Post: 2009-08-16, 15:11
  3. ISO14443Connection Security Exception
    By Alex_Polt in forum Near Field Communication
    Replies: 37
    Last Post: 2009-07-21, 09:08
  4. Security exception
    By manojkumar.m in forum Mobile Java General
    Replies: 1
    Last Post: 2008-06-17, 10:33
  5. i got the Security Exception when i call the
    By madnan_java in forum Mobile Java General
    Replies: 1
    Last Post: 2004-10-06, 12:13

Posting Permissions

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