|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.simalliance.openmobileapi.Channel
public class Channel
Instances of this class represent an ISO7816-4 channel opened to a secure element. It can be either a logical channel or the default channel. They can be used to send APDUs to the secure element. Channels are opened by calling the Session.openBasicChannel(byte[]) or Session.openLogicalChannel(byte[]) methods.
Method Summary | |
---|---|
void |
close()
Closes this channel to the Secure Element. |
byte[] |
getSelectResponse()
Returns the data as received from the application select command inclusively the status word. |
Session |
getSession()
Get the session that has opened this channel. |
boolean |
isBasicChannel()
Returns a boolean telling if this channel is the basic channel. |
boolean |
isClosed()
Tells if this channel is closed. |
boolean |
selectNext()
Performs a selection of the next Applet on this channel that matches to the partial AID specified in the openBasicChannel(byte[] aid) or openLogicalChannel(byte[] aid) method. |
byte[] |
transmit(byte[] command)
Transmit an APDU command (as per ISO7816-4) to the secure element and wait for the response. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void close()
public boolean isClosed()
true
if the channel is closed, false
otherwise.public boolean isBasicChannel()
true
if this channel is a basic channel. false
if
this channel is a logical channel.public byte[] transmit(byte[] command) throws java.io.IOException
command
- the APDU command to be transmitted, as a byte array.
java.io.IOException
- if there is a communication problem to the reader or the Secure Element.
java.lang.IllegalStateException
- if the channel is used after being closed.
java.lang.IllegalArgumentException
- if the command byte array is less than 4 bytes long.
java.lang.IllegalArgumentException
- if the length of the APDU is not coherent with the length of the command byte array.
java.lang.SecurityException
- if the command is filtered by the security
policypublic Session getSession()
public byte[] getSelectResponse()
public boolean selectNext() throws java.io.IOException
true
if new Applet was successfully selected.
false
if no further Applet exists which matches the partial AID.
java.io.IOException
- if there is a communication problem to the reader or the Secure Element.
java.lang.IllegalStateException
- if the channel is used after being closed or it is not connected.
java.lang.SecurityException
- if the command is filtered by the security policy
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |