Skip to content

licpcsc pcscd communication

jsorg71 edited this page Nov 23, 2016 · 12 revisions

libpcsc pcscd communication

1.0 Connection sequence

When an application is started that uses the lipcsc library, the connection sequence is started to connect the application to pcscd. Here is the connection sequence.

libpcsc pcscd
CMD_VERSION with header >> CMD_VERSION with header
CMD_VERSION << CMD_VERSION

1.1 Message Header The header is attached before all messages going from libpcsc to pcscd. The header includes.

type description
UINT32 Size - Message bytes
UINT32 Command - Message command see 1.3

1.2 Environment variables

The environment variable PCSCLITE_CSOCK_NAME is used to tell the pcsc library what unix domain socket to connect to.

example export PCSCLITE_CSOCK_NAME=/tmp/pcsc_test pcsc_scan

The will cause pcsc_scan to try to connect to /tmp/pcsc through the libpcsclite library.

1.3 List of commands

command hex source
SCARD_ESTABLISH_CONTEXT 0x01 SCardEstablishContext()
SCARD_RELEASE_CONTEXT 0x02 SCardReleaseContext()
Clone this wiki locally