Im trying to connect to the internal secure element on the Nokia 6131, a collegue (who has now left) of mine wrote an application that connected to the internal chip on the Nokia 3220 using SecureChipConnection, but this doesnt work on the Nokia 6131, anyone know how to do the equivilent on the Nokia 6131. The application can read balance from the card, and can write a balance to the card. The code used for the 3220 is as follows:
SecureChipConnection mScConn = SecureChipConnection.openConnection(null, this);
then to read a balance on the card:
mScConn.setSCCMode(SCCMode.SC_INTERNAL, true, null, SecureChipConnection.NO_TIMEOUT);
byte[] data = mScConn.exchangeAPDU(SELECT_ADPU);
data = mScConn.exchangeAPDU(READ_BALANCE_APDU);
and to write a balance to the card:
mScConn.setSCCMode(SCCMode.SC_INTERNAL, true, null, SecureChipConnection.NO_TIMEOUT);
byte[] data = mScConn.exchangeAPDU(SELECT_ADPU);
mScConn.exchangeAPDU(WRITE_BALANCE_APDU);
Ive tried using ISO14443Connection instead, doing:
String uri = System.getProperty("internal.se.url");
conn = (ISO14443Connection)Connector.open(uri);
but I get a ClassCastException when casting to the ISO14443Connection, the connection that Connector.open(uri) returns is of type ISO14443ConnectionImpl.
Also, if this hurdle was overcome would the reading and writing of the READ_BALANCE_APDU and WRITE_BALANCE_APDU byte arrays work as the SecureChipConnection did?
Thanks in advance,
Daniel
p.s. If im going about all this the wrong way then let me know! any suggestions are welcome.

Reply With Quote


