public interface SessionHandler
SessionHandler
interface provides all APIs to open a secure or non-secure session
with the secure processor. It is implemented by all classes providing service access to the
secure processor.Modifier and Type | Method and Description |
---|---|
void |
closeSession()
Closes the currently opened session (normal or secure) to the secure processor
|
boolean |
isSessionOpened()
Checks if a session to the secure processor is already opened
|
void |
openSession(int timeoutMs)
Opens a local session to the secure processor
(from an Android application running on the Yello terminal)
|
void |
openSession(java.nio.channels.SocketChannel channel,
java.security.cert.Certificate caCert,
java.security.cert.Certificate cert,
java.security.Key pKey,
int timeoutMs)
Opens a remote (from a PC or server) secure session to the secure processor.
|
void |
openSession(java.nio.channels.SocketChannel channel,
int timeoutMs)
Opens a remote (from PC or Server) session to the secure processor
|
void |
openSession(java.nio.channels.SocketChannel channel,
java.lang.String caCert,
java.lang.String cert,
java.lang.String pKey,
int timeoutMs)
Opens a remote (from a PC or server) secure session to the secure processor.
|
void |
openSession(java.lang.String caCert,
java.lang.String cert,
java.lang.String pKey,
int timeoutMs)
Opens a local secure session to the secure processor
(from an Android application running on the Yello terminal)
|
void |
useExistingSession(boolean secure)
Uses an existing session opened by another SessionHandler
|
void openSession(java.nio.channels.SocketChannel channel, java.lang.String caCert, java.lang.String cert, java.lang.String pKey, int timeoutMs) throws java.lang.Exception
channel
- SocketChannel opened and connected to a proxy agent running on the Yello terminalcaCert
- String containing SSL CA certificate data in PEM formatcert
- String containing an SSL client certificate data in PEM formatpKey
- String containing an SSL client private key data in PEM formattimeoutMs
- Timeout in milliseconds. If timeoutMs is <= 0, internal default timeout will be usedjava.lang.IllegalAccessException
- if a session (either secure or non-secure) is already openedjava.io.IOException
- if the session cannot be opened due to IO errors or if
the SocketChannel provided as parameter is not connected.java.lang.Exception
- for other types of exceptionsvoid openSession(java.nio.channels.SocketChannel channel, java.security.cert.Certificate caCert, java.security.cert.Certificate cert, java.security.Key pKey, int timeoutMs) throws java.lang.Exception
channel
- SocketChannel opened and connected to a proxy agent running on the Yello terminalcaCert
- SSL CA certificatecert
- SSL client certificatepKey
- SSL client private keytimeoutMs
- Timeout in milliseconds. If timeoutMs is <= 0, internal default timeout will be usedjava.lang.IllegalAccessException
- if a session (either secure or non-secure) is already openedjava.io.IOException
- if the session cannot be opened due to IO errors or if
the SocketChannel provided as parameter is not connected.java.lang.Exception
- for other types of exceptionsvoid openSession(java.lang.String caCert, java.lang.String cert, java.lang.String pKey, int timeoutMs) throws java.lang.Exception
caCert
- String containing SSL CA certificate data in PEM formatcert
- String containing an SSL client certificate data in PEM formatpKey
- String containing an SSL client private key data in PEM formattimeoutMs
- Timeout in milliseconds. If timeoutMs is <= 0, internal default timeout will be usedjava.lang.IllegalAccessException
- if a session (either secure or non-secure) is already opened.java.io.IOException
- if the session cannot be opened due to IO errors or if
the SocketChannel provided as parameter is not connected.java.lang.Exception
- for other types of exceptionsvoid openSession(java.nio.channels.SocketChannel channel, int timeoutMs) throws java.lang.Exception
channel
- SocketChannel opened and connected to a proxy agent running on the Yello terminaltimeoutMs
- Timeout in milliseconds. If timeoutMs is <= 0, internal default timeout will be usedjava.lang.IllegalAccessException
- if a session (either secure or non-secure) is already opened.java.io.IOException
- if the session cannot be opened due to IO errors or if
the SocketChannel provided as parameter is not connected.java.lang.Exception
- for other types of exceptionsvoid openSession(int timeoutMs) throws java.lang.Exception
timeoutMs
- Timeout in milliseconds. If timeoutMs is <= 0, internal default timeout will be usedjava.lang.IllegalAccessException
- if a session (either secure or non-secure) is already opened.java.io.IOException
- if the session cannot be opened due to IO errors or if
the SocketChannel provided as parameter is not connected.java.lang.Exception
- for other types of exceptionsboolean isSessionOpened()
void closeSession()
void useExistingSession(boolean secure) throws java.lang.Exception
secure
- boolean indicating whether to reused a secure session or plain sessionjava.lang.IllegalAccessException
- if no session is opened.java.lang.Exception
- for other types of exceptionsCopyright © 2019 Yello. All rights reserved.