public class Channel
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
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
received at applet selection.
|
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 ISO/IEC 7816-4) to the Secure Element.
|
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, java.lang.IllegalStateException, java.lang.IllegalArgumentException, java.lang.SecurityException, java.lang.NullPointerException
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 Lc byte is inconsistent with the length of the byte array.java.lang.IllegalArgumentException
- if CLA byte is invalid according to [2] (0xff).java.lang.IllegalArgumentException
- if INS byte is invalid according to [2] (0x6x or 0x9x).java.lang.SecurityException
- if the command is filtered by the security
policy.java.lang.NullPointerException
- if command is NULL.public Session getSession()
public byte[] getSelectResponse()
public boolean selectNext() throws java.io.IOException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException
true
if new Applet was selected on this channel.
false
he already selected Applet stays selected on this channel.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.UnsupportedOperationException
- if this operation is not supported by the card.SEEK for Android Copyright 2015, Giesecke & Devrient GmbH