The Session API provides functions to session.
Required Header
#include <smartcard.h>
Related Features
This API is related with the following features:
You can check if a device supports the related features for this API by using System Information, thereby controlling the procedure of your application.
To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.
More details on featuring your application can be found from Feature Element.
Functions |
int | smartcard_session_get_reader (int session, int *reader) |
| Gets the reader that provides the given session.
|
int | smartcard_session_get_atr (int session, unsigned char **atr, int *length) |
| Gets the Answer to Reset(ATR) of this Secure Element.
|
int | smartcard_session_close (int session) |
| Closes the connection with the Secure Element.
|
int | smartcard_session_is_closed (int session, bool *is_closed) |
| Checks if the given session is closed.
|
int | smartcard_session_close_channels (int session) |
| Closes any channel opened on the given session.
|
int | smartcard_session_open_basic_channel (int session, unsigned char *aid, int aid_len, unsigned char P2, int *channel) |
| Gets an access to the basic channel, as defined in the ISO/IEC 7816-4 specification (the one that has number 0).
|
int | smartcard_session_open_logical_channel (int session, unsigned char *aid, int aid_len, unsigned char P2, int *channel) |
| Open a logical channel with the Secure Element, selecting the Applet represented by the given Application ID(AID).
|
Function Documentation
Closes the connection with the Secure Element.
This will close any channels opened by this application with this Secure Element.
- Since :
- 2.3.1
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/secureelement
- Parameters:
-
[in] | session | handle to the session |
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
- See also:
- smartcard_reader_open_session()
Closes any channel opened on the given session.
- Since :
- 2.3.1
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/secureelement
- Parameters:
-
[in] | session | Handle to the session |
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
- See also:
- smartcard_reader_open_session()
Gets the Answer to Reset(ATR) of this Secure Element.
- Since :
- 2.3.1
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/secureelement
- Parameters:
-
[in] | session | Handle to the session |
[out] | atr | Byte array to retrieve the Answer to Reset(ATR) |
[out] | length | The length of atr |
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
- See also:
- smartcard_reader_open_session()
Gets the reader that provides the given session.
- Since :
- 2.3.1
- Parameters:
-
[in] | session | Handle to the session |
[out] | reader | Reader handle that provides the given session |
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
- See also:
- smartcard_reader_open_session()
Checks if the given session is closed.
- Since :
- 2.3.1
- Parameters:
-
[in] | session | Handle to the session |
[out] | is_closed | True or false depending on the session state |
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
- See also:
- smartcard_reader_open_session()
Gets an access to the basic channel, as defined in the ISO/IEC 7816-4 specification (the one that has number 0).
- Since :
- 2.3.1
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/secureelement
- Parameters:
-
[in] | session | Handle to the session |
[in] | aid | Byte array containing the Application ID(AID) to be selected on the given channel |
[in] | aid_len | Size of byte array or 0 when no SELECT should be executed |
[in] | P2 | P2 byte of the SELECT command if executed |
[out] | channel | Handle of the basic channel |
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
- See also:
- smartcard_reader_open_session()
Open a logical channel with the Secure Element, selecting the Applet represented by the given Application ID(AID).
- Since :
- 2.3.1
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/secureelement
- Parameters:
-
[in] | session | Handle to the session |
[in] | aid | Byte array containing the Application ID(AID) to be selected on the given channel |
[in] | aid_len | Size of byte array or 0 when no SELECT should be executed |
[in] | P2 | P2 byte of the SELECT command if executed |
[out] | channel | Handle of the new logical channel |
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
- See also:
- smartcard_reader_open_session()