sc_attach_by_smart_card_id()

Open a session to the smart card that corresponds to a card ID.

Synopsis:

#include <smartcard/sc_smart_card.h>
 
sc_response_code_t sc_attach_by_smart_card_id(sc_context_t *context,                 
                                              sc_smart_card_id_t *smart_card_id,                 
                                              sc_handle_type_t handle_type,                 
                                              sc_card_access_mode_t card_access_mode)

Since:

BlackBerry 10.2.0

Arguments:

context

The active smart card context. This value cannot be NULL.

smart_card_id

The smart card ID to attach to. This value cannot be NULL.

handle_type

The type of smart card resource the session is used with. For example, if the smart card is used to perform cryptographic operations, then specify a value of SC_HANDLE_CARD_CRYPTO_PROVIDER_X.

card_access_mode

This parameter indicates whether the connection is opened for shared or exclusive access. If the requested mode is unavailable, an error is returned.

Library:

libscs (For the qcc command, use the -l scs option to link against this library)

Description:

If the expected card is not found, the user is prompted to insert the specified card based on the provided card ID.

If this function completely successfully, a smart card handle is added to the provided context. For this reason, it is necessary to explicitly release the handle using sc_free_handle() before another smart card handle can be allocated.

Returns:

SC_SCARD_S_SUCCESS upon success, one of the following error codes otherwise: