PCSCD(8)

๐Ÿ’– PCSCD(8) โ€” the PC/SC Smart Card Daemon, bestie! ๐Ÿ’–

Okay so listen up bestie, because this is pcscd โ€” literally the PC/SC Smart Card Daemon from the PC/SC Lite universe, and it's about to be your new fave. No cap, this page is giving full main character energy for your smart card setup. ๐ŸŽ€โœจ


โœจ SYNOPSIS โœจ

Like, here's how you summon it:

pcscd [-acfTdeCvHSI] [--apdu] [--config dir] [--foreground] [--color]
      [--debug] [--info] [--error] [--critical] [--force-reader-polling]
      [-t number] [--max-thread number] [-s number]
      [--max-card-handle-per-thread number] [-r number]
      [--max-card-handle-per-reader number] [--version] [--hotplug]
      [--reader-name-no-serial] [--reader-name-no-interface] [--disable-
      polkit]

pcscd -h
pcscd --help

๐ŸŒธ OPTIONS ๐ŸŒธ

Every single flag, accounted for. Periodt. ๐Ÿ’…

  • -a, --apdu โ€” logs APDUs and SW using the debug method (peep --debug for that one). It's giving "I want to see everything" energy. ๐Ÿ‘€
  • -c, --config dir โ€” tells pcscd to use the directory dir as an alternate location for /etc/reader.conf.d/. The argument can also be a single configuration file (for backward compatibility, because we respect the old ways ๐Ÿซถ).
  • -f, --foreground โ€” runs pcscd in the foreground and sends log messages to stderr instead of syslog(3). Lowkey perfect for when you want all the tea right in front of you. โ˜•
  • -T, --color โ€” forces use of colored logs. Because obviously we need aesthetics in our terminal. ๐ŸŒˆ
  • -d, --debug โ€” uses the lowest log level. Any log message of this level or above gets sent to stderr or syslog(3), depending on whether you used --foreground. Maximum detail, maximum vibes. ๐Ÿ”
  • --info โ€” uses info log level. This is the default log level, so it's the "I'm just chilling" setting. โœจ
  • -e, --error โ€” uses error log level. Only the dramatic stuff gets logged. ๐Ÿ˜ญ
  • -C, --critical โ€” uses critical log level. Like, emergencies only, bestie. ๐Ÿ’€

The log levels are ordered like this: debug < info < error < critical. Use a log level l and it will log this level plus all the levels above it. So basically it's a "from here upward" situation. ๐Ÿ“ˆ

  • --force-reader-polling โ€” ignores the IFD_GENERATE_HOTPLUG reader capability. It's giving "I'll do it myself" energy. ๐Ÿ™ˆ
  • -t, --max-thread number โ€” maximum number of threads (default 200). This is the maximum number of clients (SCardEstablishContext) that pcscd can handle. So like, 200 besties can connect at once. ๐Ÿซถ
  • -s, --max-card-handle-per-thread number โ€” maximum number of card handle per thread (default: 200). This is the maximum number of card handle (SCardConnect) per client (SCardEstablishContext). One client can have up to 200 card connections. Slay. ๐Ÿ’ณ
  • -r, --max-card-handle-per-reader number โ€” maximum number of card handle per reader (default: 200). This is the maximum number of card handle (SCardConnect) per reader. Each reader gets its own 200-handle allowance. Iconic. ๐Ÿ‘‘
  • -h, --help โ€” displays information about the pcscd command line. The classic "help me help you" moment. ๐Ÿ†˜
  • -v, --version โ€” displays the program version number. Gotta know what era of pcscd you're in. ๐Ÿ•ฐ๏ธ
  • -H, --hotplug โ€” asks pcscd to re-read the /etc/reader.conf.d/my_reader.conf files to detect added or removed non-USB readers (serial or PCMCIA). Like a vibe check for your hardware. ๐Ÿ”Œ
  • -x, --auto-exit โ€” pcscd will quit after 60 seconds of inactivity after the release of the last PC/SC context. This is used when pcscd is started on demand by systemd. It's the "okay bye, see you when you need me" setting. ๐Ÿ‘‹
  • -S, --reader-name-no-serial โ€” do not include the USB serial number in the reader name. Minimalist era. โœจ
  • -I, --reader-name-no-interface โ€” do not include the USB interface name in the reader name. Also minimalist. ๐ŸŽ€
  • --disable-polkit โ€” ignores polkit rules. All accesses are allowed. It's giving "no rules, just vibes" โ€” but like, be careful bestie, this is a security thing. ๐Ÿšจ

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

pcscd is the daemon program for pcsc-lite. It is a resource manager that coordinates communications with smart card readers and smart cards and cryptographic tokens that are connected to the system. Basically it's the ultimate middleman, and it's doing the most so your apps don't have to. ๐Ÿ’…

It allows applications to access smart cards and readers using the WinSCard API, but without knowing details of the card or reader. So your apps get to stay clueless and happy. ๐Ÿ™ˆ

pcscd coordinates the loading of drivers for card readers. It's the driver-wrangler. The reader-whisperer. The card-coordinator. ๐ŸŽ€


๐ŸŒˆ SERIAL SMART CARD READER DRIVERS ๐ŸŒˆ

Smart card reader drivers are placed in the /usr/lib64/pcsc/drivers directory. Each driver is simply an .so file. pcscd locates the driver using the /etc/reader.conf.d/my_reader.conf files. Peep the reader.conf(5) manual page for more information. ๐Ÿ“–

Some drivers are available at https://muscle.apdu.fr/musclecard.com/drivers.html. Like, go get 'em bestie. ๐Ÿ”—


โญ USB SMART CARD READER DRIVERS โญ

USB smart card reader drivers are located in /usr/lib64/pcsc/drivers directory as a bundle.

โš ๏ธ You shall NOT add a USB driver in a /etc/reader.conf.d/my_reader.conf file. That's a big no-no, bestie. Don't do it. ๐Ÿ™…โ€โ™€๏ธ

๐ŸŽ€ CONFIGURATION FILE ๐ŸŽ€

It is possible to set arguments that will be used by pcscd with the configuration file /etc/default/pcscd. For example, you can increase the debug level using:

PCSCD_ARGS=--debug

Or set environment variables like:

PCSCLITE_FILTER_IGNORE_READER_NAMES="Twin"
PCSCLITE_FILTER_EXTEND_READER_NAMES=" $HOSTNAME"

See https://blog.apdu.fr/posts/2021/08/pcsc-lite-configuration-using/ for more details. It's like the deep-dive blog post, iykyk. ๐Ÿ“


๐Ÿ”ฅ UDEV USB READER FILTERING (LINUX ONLY) ๐Ÿ”ฅ

If udev support is enabled, setting the udev property PCSCLITE_IGNORE=1 on a USB device will cause that reader to be ignored.

For example, to ignore any reader attached to USB port 3 of bus 1, add the following to a foobar.rules file in the /etc/udev/rules.d/ directory:

ACTION!="remove|unbind", SUBSYSTEM=="usb", KERNEL=="1-3", ENV{PCSCLITE_IGNORE}="1"

Basically, you're telling udev to just not see that reader. Ghosted. ๐Ÿ‘ป


๐Ÿ’œ FILES ๐Ÿ’œ

  • /etc/default/pcscd : daemon configuration file. The config bestie. ๐Ÿ“‹
  • /etc/reader.conf.d/* : Serial reader configuration files. All the serial reader tea. โ˜•
  • /run/pcscd/pcscd.pid : process id of the running pcscd. Where the pid lives. ๐Ÿ”ข
  • /usr/lib64/pcsc/drivers/ : directory containing bundles for USB drivers. The driver hangout spot. ๐Ÿ 

๐Ÿซถ SEE ALSO ๐Ÿซถ

reader.conf(5), syslog(3), udev(7). Go read these too, bestie. They're part of the lore. ๐Ÿ“š


๐Ÿ‘‘ AUTHORS ๐Ÿ‘‘

David Corcoran <corcoran@musclecard.com> and Ludovic Rousseau <ludovic.rousseau@free.fr>. The legends who made this happen. Respect. ๐Ÿ’–


This page is a Muscle production, dropped December 2021, and it's literally the PCSCD(8) manual, bestie. You're welcome. โœจ๐Ÿ’…๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from