public class Session
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
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)
This method is provided to ease the development of mobile application and for compliancy
with existing applications.
|
Channel |
openBasicChannel(byte[] aid,
byte p2)
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)
This method is provided to ease the development of mobile application and for compliancy
with existing applications.
|
Channel |
openLogicalChannel(byte[] aid,
byte p2)
Open a logical channel with the Secure Element, selecting the Applet represented by
the given AID.
|
public Reader getReader()
public byte[] getATR()
public void close()
public boolean isClosed()
true
if the session is closed, false otherwise.public void closeChannels()
public Channel openBasicChannel(byte[] aid, byte p2) throws java.io.IOException, java.lang.IllegalStateException, java.lang.IllegalArgumentException, java.lang.SecurityException, java.util.NoSuchElementException, java.lang.UnsupportedOperationException
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.p2
- the P2 parameter of the SELECT APDU executed on this channel.java.io.IOException
- if there is a communication problem to the reader or
the Secure Element.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 Applet on this
session.java.util.NoSuchElementException
- if the AID on the Secure Element is not available or cannot be
selected.java.lang.UnsupportedOperationException
- if the given P2 parameter is not
supported by the devicepublic Channel openBasicChannel(byte[] aid) throws java.io.IOException, java.lang.IllegalStateException, java.lang.IllegalArgumentException, java.lang.SecurityException, java.util.NoSuchElementException, java.lang.UnsupportedOperationException
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.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 Applet on this
session.java.util.NoSuchElementException
- if the AID on the Secure Element is not available or cannot be
selected.java.lang.UnsupportedOperationException
- if the given P2 parameter is not
supported by the devicepublic Channel openLogicalChannel(byte[] aid, byte p2) throws java.io.IOException, java.lang.IllegalStateException, java.lang.IllegalArgumentException, java.lang.SecurityException, java.util.NoSuchElementException, java.lang.UnsupportedOperationException
aid
- the AID of the Applet to be selected on this channel, as a
byte array.p2
- the P2 parameter of the SELECT APDU executed on this channel.java.io.IOException
- if there is a communication problem to the reader or
the Secure Element.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 Applet on this
session.java.util.NoSuchElementException
- if the AID on the Secure Element is not
available or cannot be selected or a logical channel is already
open to a non-multiselectable Applet.java.lang.UnsupportedOperationException
- if the given P2 parameter is not
supported by the device.public Channel openLogicalChannel(byte[] aid) throws java.io.IOException, java.lang.IllegalStateException, java.lang.IllegalArgumentException, java.lang.SecurityException, java.util.NoSuchElementException, java.lang.UnsupportedOperationException
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.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 Applet on this
session.java.util.NoSuchElementException
- if the AID on the Secure Element is not
available or cannot be selected or a logical channel is already
open to a non-multiselectable Applet.java.lang.UnsupportedOperationException
- if the given P2 parameter is not
supported by the device.SEEK for Android Copyright 2015, Giesecke & Devrient GmbH