|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.simalliance.openmobileapi.Session
public class Session
Instances of this class represent a connection session to one of the secure elements available on the device. These objects can be used to get a communication channel with an application in the secure element. This channel can be the basic channel or a logical channel.
Method Summary | |
---|---|
void |
close()
Close the connection with the Secure Element. |
void |
closeChannels()
Close any channel opened on this session. |
byte[] |
getATR()
Get the Answer to Reset of this Secure Element. |
Reader |
getReader()
Get the reader that provides this session. |
boolean |
isClosed()
Tells if this session is closed. |
Channel |
openBasicChannel(byte[] aid)
Get an access to the basic channel, as defined in the ISO/IEC 7816-4 specification (the one that has number 0). |
Channel |
openLogicalChannel(byte[] aid)
Open a logical channel with the Secure Element, selecting the Applet represented by the given AID. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public Reader getReader()
public byte[] getATR()
public void close()
public boolean isClosed()
true
if the session is closed, false otherwise.public void closeChannels()
java.io.IOException
public Channel openBasicChannel(byte[] aid) throws java.io.IOException
The optional select response data of an applet can be retrieved with byte[] getSelectResponse().
aid
- the AID of the Applet to be selected on this channel, as a byte array, or null if no Applet is to be
selected.
java.io.IOException
- if there is a communication problem to the reader or the Secure Element (e.g. if the SE is not responding).
java.lang.IllegalStateException
- if the Secure Element session is used after being closed.
java.lang.IllegalArgumentException
- if the aid's length is not within 5 to
16 (inclusive).
java.lang.SecurityException
- if the calling application cannot be granted
access to this AID or the default application on this
session.
java.util.NoSuchElementException
- if an Applet with the defined AID does not exist in the SEpublic Channel openLogicalChannel(byte[] aid) throws java.io.IOException
The optional select response data of an applet can be retrieved with byte[] getSelectResponse().
A logical channel to an applet can be opened multiple times if the applet implements MultiSelectable.
aid
- the AID of the Applet to be selected on this channel, as
a byte array.
java.io.IOException
- if there is a communication problem to the reader or the Secure Element. (e.g. if the SE is
not responding)
java.lang.IllegalStateException
- if the Secure Element is used after being
closed.
java.lang.IllegalArgumentException
- if the aid's length is not within 5 to
16 (inclusive).
java.lang.SecurityException
- if the calling application cannot be granted
access to this AID or the default application on this
session.
java.util.NoSuchElementException
- if an Applet with the defined AID does not exist in the SE or a logical channel is already open to a non-multiselectable applet
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |