Tizen Native API
4.0
|
The Channel API provides functions to channel.
#include <smartcard.h>
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_channel_close (int channel) |
Closes the given channel to the Secure Element. | |
int | smartcard_channel_is_basic_channel (int channel, bool *is_basic_channel) |
Checks if the given channel is the basic channel. | |
int | smartcard_channel_is_closed (int channel, bool *is_closed) |
Checks if the given channel is closed. | |
int | smartcard_channel_get_select_response (int channel, unsigned char **select_resp, int *length) |
Gets the response to the select command. | |
int | smartcard_channel_get_session (int channel, int *session) |
Gets the session that has opened the given channel. | |
int | smartcard_channel_transmit (int channel, unsigned char *cmd, int cmd_len, unsigned char **resp, int *length) |
Transmits an APDU command (as per ISO/IEC 7816-4) to the Secure Element. | |
int | smartcard_channel_transmit_retrieve_response (int channel, unsigned char **resp, int *length) |
Helper function to retrieves the response APDU of the previous transmit() call. | |
int | smartcard_channel_select_next (int channel, bool *is_success) |
Performs a selection of the next Applet on the given channel that matches to the partial Application ID(AID) |
int smartcard_channel_close | ( | int | channel | ) |
Closes the given channel to the Secure Element.
[in] | channel | Handle to the channel |
SMARTCARD_ERROR_NONE | Successful |
SMARTCARD_ERROR_GENERAL | A general error occurred |
SMARTCARD_ERROR_INVALID_PARAMETER | Invalid function parameter |
SMARTCARD_ERROR_IO_ERROR | I/O error |
SMARTCARD_ERROR_NOT_INITIALIZED | Smartcard service not initialized |
SMARTCARD_ERROR_NOT_SUPPORTED | Not supported |
SMARTCARD_ERROR_PERMISSION_DENIED | Permission denied |
int smartcard_channel_get_select_response | ( | int | channel, |
unsigned char ** | select_resp, | ||
int * | length | ||
) |
Gets the response to the select command.
[in] | channel | Handle to the channel |
[out] | select_resp | Byte array to retrieve the SELECT response |
[out] | length | The length of select_resp |
SMARTCARD_ERROR_NONE | Successful |
SMARTCARD_ERROR_GENERAL | A general error occurred |
SMARTCARD_ERROR_INVALID_PARAMETER | Invalid function parameter |
SMARTCARD_ERROR_NOT_INITIALIZED | Smartcard service not initialized |
SMARTCARD_ERROR_NOT_SUPPORTED | Not supported |
int smartcard_channel_get_session | ( | int | channel, |
int * | session | ||
) |
Gets the session that has opened the given channel.
[in] | channel | Handle to the channel |
[out] | session | Session handle of the given channel |
SMARTCARD_ERROR_NONE | Successful |
SMARTCARD_ERROR_GENERAL | A general error occurred |
SMARTCARD_ERROR_INVALID_PARAMETER | Invalid function parameter |
SMARTCARD_ERROR_NOT_INITIALIZED | Smartcard service not initialized |
SMARTCARD_ERROR_NOT_SUPPORTED | Not supported |
int smartcard_channel_is_basic_channel | ( | int | channel, |
bool * | is_basic_channel | ||
) |
Checks if the given channel is the basic channel.
[in] | channel | Handle to the channel |
[out] | is_basic_channel | True or false depending on the channel type |
SMARTCARD_ERROR_NONE | Successful |
SMARTCARD_ERROR_GENERAL | A general error occurred |
SMARTCARD_ERROR_INVALID_PARAMETER | Invalid function parameter |
SMARTCARD_ERROR_NOT_INITIALIZED | Smartcard service not initialized |
SMARTCARD_ERROR_NOT_SUPPORTED | Not supported |
int smartcard_channel_is_closed | ( | int | channel, |
bool * | is_closed | ||
) |
Checks if the given channel is closed.
[in] | channel | Handle to the channel |
[out] | is_closed | True or false depending on the channel state |
SMARTCARD_ERROR_NONE | Successful |
SMARTCARD_ERROR_GENERAL | A general error occurred |
SMARTCARD_ERROR_INVALID_PARAMETER | Invalid function parameter |
SMARTCARD_ERROR_NOT_INITIALIZED | Smartcard service not initialized |
SMARTCARD_ERROR_NOT_SUPPORTED | Not supported |
int smartcard_channel_select_next | ( | int | channel, |
bool * | is_success | ||
) |
Performs a selection of the next Applet on the given channel that matches to the partial Application ID(AID)
[in] | channel | Handle to the channel |
[out] | is_success | True or false depending whether another applet with the partial Application ID(AID) could be selected on the given channel |
SMARTCARD_ERROR_NONE | Successful |
SMARTCARD_ERROR_GENERAL | A general error occurred |
SMARTCARD_ERROR_INVALID_PARAMETER | Invalid function parameter |
SMARTCARD_ERROR_ILLEGAL_STATE | Illegal state of execution error |
SMARTCARD_ERROR_OPERATION_NOT_SUPPORTED | Operation not supported from SE |
SMARTCARD_ERROR_IO_ERROR | I/O error |
SMARTCARD_ERROR_NOT_INITIALIZED | Smartcard service not initialized |
SMARTCARD_ERROR_NOT_SUPPORTED | Not supported |
SMARTCARD_ERROR_PERMISSION_DENIED | Permission denied |
int smartcard_channel_transmit | ( | int | channel, |
unsigned char * | cmd, | ||
int | cmd_len, | ||
unsigned char ** | resp, | ||
int * | length | ||
) |
Transmits an APDU command (as per ISO/IEC 7816-4) to the Secure Element.
[in] | channel | Handle to the channel |
[in] | cmd | Command APDU to be send to the secure element |
[in] | cmd_len | Size of command APDU |
[out] | resp | Byte array for the response APDU plus status words |
[out] | length | The length of resp |
SMARTCARD_ERROR_NONE | Successful |
SMARTCARD_ERROR_GENERAL | A general error occurred |
SMARTCARD_ERROR_INVALID_PARAMETER | Invalid function parameter |
SMARTCARD_ERROR_ILLEGAL_STATE | Illegal state of execution error |
SMARTCARD_ERROR_IO_ERROR | I/O error |
SMARTCARD_ERROR_NOT_INITIALIZED | Smartcard service not initialized |
SMARTCARD_ERROR_NOT_SUPPORTED | Not supported |
SMARTCARD_ERROR_PERMISSION_DENIED | Permission denied |
int smartcard_channel_transmit_retrieve_response | ( | int | channel, |
unsigned char ** | resp, | ||
int * | length | ||
) |
Helper function to retrieves the response APDU of the previous transmit() call.
[in] | channel | Handle to the channel |
[out] | resp | Byte array for the response APDU plus status words |
[out] | length | The length of resp |
SMARTCARD_ERROR_NONE | Successful |
SMARTCARD_ERROR_GENERAL | A general error occurred |
SMARTCARD_ERROR_INVALID_PARAMETER | Invalid function parameter |
SMARTCARD_ERROR_ILLEGAL_STATE | Illegal state of execution error |
SMARTCARD_ERROR_NOT_INITIALIZED | Smartcard service not initialized |
SMARTCARD_ERROR_NOT_SUPPORTED | Not supported |