libsmartcard(3LIB) Interface Libraries libsmartcard(3LIB)NAME
libsmartcard - smartcard library
SYNOPSIS
cc [ flag... ] file... -lsmartcard [ library...]
#include <smartcard/scf.h>
DESCRIPTION
Functions in this library allow an application to select a smartcard terminal, determine when cards are inserted or removed, and exchange
data with the card.
INTERFACES
The shared object libsmartcard.so.1 provides the public interfaces defined below. See intro(3) for additional information on shared object
interfaces.
SCF_Card_close SCF_Card_exchangeAPDU
SCF_Card_freeInfo SCF_Card_getInfo
SCF_Card_lock SCF_Card_reset
SCF_Card_unlock SCF_Card_waitForCardRemoved
SCF_Session_close SCF_Session_freeInfo
SCF_Session_getInfo SCF_Session_getSession
SCF_Session_getTerminal SCF_Terminal_addEventListener
SCF_Terminal_close SCF_Terminal_freeInfo
SCF_Terminal_getCard SCF_Terminal_getInfo
SCF_Terminal_removeEventListener SCF_Terminal_updateEventListener
SCF_Terminal_waitForCardAbsent SCF_Terminal_waitForCardPresent
SCF_strerror
FILES
/usr/lib/libsmartcard.so.1 shared object
/usr/lib/64/libsmartcard.so.1 64-bit shared object
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWocf |
+-----------------------------+-----------------------------+
|Availability |SUNWocf (32-bit) |
+-----------------------------+-----------------------------+
| |SUNWocfx (64-bit) |
+-----------------------------+-----------------------------+
|Interface Stability |Evolving |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO smartcard(1M), intro(3), attributes(5), smartcard(5)SunOS 5.10 22 May 2003 libsmartcard(3LIB)
Check Out this Related Man Page
SCF_Session_close(3SMARTCARD) Smartcard Library Functions SCF_Session_close(3SMARTCARD)NAME
SCF_Session_close, SCF_Terminal_close, SCF_Card_close - close a smartcard session, terminal, or card
SYNOPSIS
cc [ flag... ] file... -lsmartcard [ library...]
#include <smartcard/scf.h>
SCF_Status_t SCF_Session_close(SCF_Session_t session);
SCF_Status_t SCF_Terminal_close(SCF_Terminal_t terminal);
SCF_Status_t SCF_Card_close(SCF_Card_t card);
PARAMETERS
card An object that was returned from SCF_Terminal_getCard(3SMARTCARD)
session An object that was returned from SCF_Session_getSession(3SMARTCARD)
terminal An object that was returned from SCF_Session_getTerminal(3SMARTCARD)DESCRIPTION
These functions release the resources (memory, threads, and others) that were allocated within the library when the session, terminal, or
card was opened. Any storage allocated by calls to SCF_Session_getInfo(3SMARTCARD), SCF_Terminal_getInfo(3SMARTCARD), or SCF_Card_get-
Info(3SMARTCARD) is deallocated when the associated object is closed. Attempts to access results from these interfaces after the object has
been closed results in undefined behavior.
If a card that was locked by SCF_Card_lock(3SMARTCARD) is closed, the lock is automatically released. When a terminal is closed, any event
listeners on that terminal object are removed and any cards that were obtained with the terminal are closed. Similarly, closing a session
will close any terminals or cards obtained with that session. These are the only cases where the library will automatically perform a
close.
Once closed, a session, terminal, or card object can no longer be used by an SCF function. Any attempt to do so results in an SCF_STA-
TUS_BADHANDLE error. The sole exception is that closing an object, even if already closed, is always a successful operation.
RETURN VALUES
Closing a handle is always a successful operation that returns SCF_STATUS_SUCCESS. The library can safely detect handles that are invalid
or already closed.
EXAMPLES
Example 1: Close each object explicitly.
SCF_Status_t status;
SCF_Session_t mySession;
SCF_Terminal_t myTerminal;
SCF_Card_t myCard;
status = SCF_Session_getSession(&mySession);
if (status != SCF_STATUS_SUCCESS) exit(1);
status = SCF_Session_getTerminal(mySession, NULL, &myTerminal);
if (status != SCF_STATUS_SUCCESS) exit(1);
status = SCF_Terminal_getCard(myTerminal, &myCard);
if (status != SCF_STATUS_SUCCESS) exit(1);
/* (Do interesting things with smartcard...) */
SCF_Card_close(myCard);
SCF_Terminal_close(myTerminal);
SCF_Session_close(mySession);
Example 2: Allow the library to close objects.
SCF_Status_t status;
SCF_Session_t mySession;
SCF_Terminal_t myTerminal;
SCF_Card_t myCard;
status = SCF_Session_getSession(&mySession);
if (status != SCF_STATUS_SUCCESS) exit(1);
status = SCF_Session_getTerminal(mySession, NULL, &myTerminal);
if (status != SCF_STATUS_SUCCESS) exit(1);
status = SCF_Terminal_getCard(myTerminal, &myCard);
if (status != SCF_STATUS_SUCCESS) exit(1);
/* (Do interesting things with smartcard...) */
SCF_Session_close(mySession);
/* myTerminal and myCard have been closed by the library. */
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Evolving |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO libsmartcard(3LIB), SCF_Card_getInfo(3SMARTCARD), SCF_Card_lock(3SMARTCARD), SCF_Session_getInfo(3SMARTCARD), SCF_Session_getSes-
sion(3SMARTCARD), SCF_Session_getTerminal(3SMARTCARD), SCF_Terminal_getCard(3SMARTCARD), SCF_Terminal_getInfo(3SMARTCARD), attributes(5)SunOS 5.10 14 May 2002 SCF_Session_close(3SMARTCARD)