provides initialization, input, output, and other basic routines for ISO
7816 smart cards.
Many of the routines return a status word.
This will either be an error code as given in the include file,
or a SW1/SW2 pair as specified in ISO 7816.
opens a connection to a smart card via serial port number
numbered from 0, which corresponds to /dev/tty00 on UNIX.
If there is no card in the reader,
will either wait for card insertion, or if flag
is given, it will return immediately with error
points to a status word that will be set on return.
resets the card and returns the ATR in the buffer pointed to by
if it is not
flag is given, a connection to the card will be established
using default protocol parameters even if the card ATR is illegal.
sends an APDU to the card with optional IN and OUT data.
cla - application class
ins - instruction code
p1, p2 - per ISO 7816-3 or application dependent
ilen - length of IN data
ibuf - pointer to IN data
olen - length of OUT data
obuf - pointer to OUT data
swp - pointer to return status word
returns whether a card is present in the reader.
closes a connection to a smart card.
selects a file given its FID by sending a "select" apdu to the card.
returns a printable name for a FID.
parses a card ATR and returns the protocol parameters.
flag is given it will print the parameters to standard out.
translates a printable name to a FID.
looks up the error message string affiliated with a status word
and writes it to standard out.
returns 1 if
indicates success, or 0 if it indicates failure.