Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
Bamaco
Posts: 10
Registered: ‎03-28-2012
My Device: Torch 9810

java.lang.SecurityException: JSR 177 access for this connection is not permitted

I'm trying to communicate with a SIM card using the APDUConnection with the SAT target, but I get this exception:

 

"java.lang.SecurityException: JSR 177 access for this connection is not permitted"

 

private final String kURL = "apdu:0;target=SAT";


public void Test()
{
 APDUConnection acn = null;
 try
 {
 	//Create an APDUConnection object
 	acn = (APDUConnection)  Connector.open(kURL);
 	
	// ...		
 		   
 }
 catch( SecurityException e)
 {
 	String exceptionMsg = "SecurityException: " + e.toString();
 	System.err.println(exceptionMsg);
 }
 // ...
}

 

The documentation hints that I am not allowed to change a PIN, but in this case, I'm just trying to open the connection. 

 

What's the problem?

BlackBerry Development Advisor
MSohm
Posts: 14,850
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: java.lang.SecurityException: JSR 177 access for this connection is not permitted

Is there a trusted applet installed on the sim card that you are trying to communicate with? 

 

Direct access to the SIM card is not supported.  You'd need an applet on it to communicate with.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Contributor
Bamaco
Posts: 10
Registered: ‎03-28-2012
My Device: Torch 9810

Re: java.lang.SecurityException: JSR 177 access for this connection is not permitted

Hi,

 

The SIM card does not contain an applet. It contains C++ firmware capable of exchanging APDU commands and returning results. I 'm trying to open with the SAT (Sim Application Toolkit)  target.

 

Why can't I directly access the sim card?

 

The APDUConnection clearly supports the SAT target.

 

The SIM card that I'm trying to access does not have a JavaCard VM on it, but it contains an application meant to exchange APDU's.

 

Using other sim cards, { Bell, Telus, Rogers, SwissComm } I am able to open the APDU connection and get the ATR.

BlackBerry Development Advisor
MSohm
Posts: 14,850
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: java.lang.SecurityException: JSR 177 access for this connection is not permitted

Carriers control access to what is available on the sim card.  Have you contacted the carrier of this sim to verify if they allow this?

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Contributor
Bamaco
Posts: 10
Registered: ‎03-28-2012
My Device: Torch 9810

Re: java.lang.SecurityException: JSR 177 access for this connection is not permitted

There is no carrier for.now. This is a proof of concept BB smartphone & SimCard project. We have a consultant making the SimCart c++ based OS. Once the proof of concept is done, we will talk with carrier(s) to put their OS/App on our SimCard.

The sim card exchanges APDU just fine with PC/SC.

I want to do the same using my BB Java application.