Use a DSC USB Token on Linux
Detect a DSC USB token on Linux, install what its driver needs, sign a PDF and protect your PIN retries: a walkthrough for Indian DSC users.
On this page
Using a DSC USB token on Linux means getting four parties to agree: the smart card service, your token vendor’s driver, a signing program and you, holding a PIN. This walkthrough goes from plugged in to signed PDF with tda-dsc-signer, an open source app I wrote, and says plainly which parts are verified.
Important
Signing and verification are verified on real hardware with one family, InnaIT from Precision Biometric. Other tokens are untested. The commands below assume Arch Linux where a package manager is involved.
What a USB token on Linux needs
The private key lives inside the token and signs inside the token. Everything on your computer exists to ask it politely.
| Layer | Where it comes from | Its job |
|---|---|---|
pcscd | the pcsclite package | the smart card service |
| CCID driver | the ccid package | talks to USB readers |
| PKCS#11 library | your token’s vendor | speaks to your token |
| Signing program | tda-dsc-signer here | asks the library to sign |
Your token presents itself as a reader, which is why the CCID driver is involved at all. The signer ships no vendor library.
Notice how little of that chain is the signing program. When something fails, the symptom at the top is usually the same, an empty list, while the cause can sit in any layer below it. So it pays to know which layer you are asking before you reinstall everything in sight. The Arch wiki page on smart cards is a good companion if you want the wider picture.
Install the pieces
sudo pacman -S --needed pcsclite ccid gtk4 poppler-glib python-gobject python-cairo nss usbutils p11-kit uv git make
sudo systemctl enable --now pcscd.socketThose are the Arch package names. On other distributions, you need Python 3.12 or newer, GTK4, poppler-glib, PyGObject, pcsclite, ccid, git, make and uv. Then build from source, and the command lands in ~/.local/bin:
git clone https://github.com/TheDarkArtist/tda-dsc-signer
cd tda-dsc-signer
make installNow install your vendor’s PKCS#11 driver. For InnaIT the library is libInnaITPKCS11Driver.so. The signer looks at modules registered with p11-kit and at known vendor paths, and you can add others with the DSC_MODULES variable or extra_modules in its config.
Caution
A driver is native code that will receive your PIN. A library file owned by your user, and not by root, is loaded only if you allow it explicitly with --allow-user-module or the allowed_modules setting. Allow only files you got from the vendor.
Check that the token is detected
Plug the token in, then ask two questions. Neither needs a PIN.
tda-dsc-signer doctor
tda-dsc-signer listlist prints the signing certificates on attached tokens, with the numbers you pass to -t when more than one is plugged in. If it prints them, skip ahead to signing. If it does not, follow the branch that matches:
flowchart TD
A["list shows no certificate"] --> B["Run doctor"]
B --> C{"What fails?"}
C -->|"smart card service"| D["Enable the pcscd socket"]
C -->|"vendor driver"| E["Install the vendor package"]
C -->|"device list"| F["Add your token to the CCID list"]
C -->|"driver in use"| G["Close the other signer"]doctor prints a suggested fix for what fails and never runs it. Apply one fix, run list again, and only then move to the next. It exits with code 1 if any check fails.
doctor looks at | The question |
|---|---|
| Smart card service | is pcscd or its socket active? |
| USB device, CCID list, package hook | is the InnaIT token seen, listed and covered by the hook? |
| Vendor driver | does the InnaIT library load? |
| Driver in use | is another copy of the signer holding it? |
| Desktop entry | can a launcher start the app? |
The USB, device list, hook and driver rows are written around the InnaIT token, so on any other brand read those rows as being about a token you do not have.
Seeing no tokens while one is clearly plugged in? Look for a second guest at the driver. Vendor drivers and readers cannot be shared, and Seahorse, OpenSC tools, a browser’s smart card module or another signer window can all be holding it. Close that program and try again. When the other holder is a second copy of the signer, the command says the driver is busy, exits with code 3, and --wait-driver 30 will wait up to thirty seconds for it.
If the InnaIT token is not recognised
The CCID driver keeps a list of devices it knows. If your InnaIT token shows up in lsusb as 338c:0031 but the signer’s doctor says the list lacks it, the entry has to be added. The file is /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Info.plist, and it holds three parallel arrays. Append one value to the end of each, then restart the service:
| Array | Value to append |
|---|---|
ifdVendorID | 0x338C |
ifdProductID | 0x0031 |
ifdFriendlyName | InnaitKey DSC |
sudo systemctl restart pcscd.service pcscd.socketWarning
That file belongs to the ccid package, so the next upgrade rewrites it and your token vanishes again.
You have two choices. Protect your edited file with pacman’s NoUpgrade setting, and remember that you then stop receiving new entries in it. Or use the optional pacman hook kept in the repository’s packaging folder, which reapplies the edit after each upgrade. The hook modifies a file owned by another package, and pacman -Qkk ccid will say so. If that trade sounds odd, it is worth reading how package managers decide what ends up on your disk.
Look after your PIN
A token counts wrong PINs and locks when the count runs out. Unblocking is then a matter for the issuer. So do not guess.
The signer makes exactly one login for each signing action and never retries it. Three situations get extra care:
| Situation | What you need |
|---|---|
| Token reports it is locked | the issuer, no login is attempted |
| Token reports its final try | --confirm-final-try |
| Quick retry after a wrong PIN | --confirm-after-failure |
Do not read silence from the token as a sign that tries remain. When in doubt, stop and check which PIN you are about to type.
Type the PIN at the prompt. Keeping it in a script or an environment variable is a habit worth refusing. Saving it is off unless you turn it on:
tda-dsc-signer pin set -t 1 # store it in your system keyring
tda-dsc-signer pin status # what is saved, never the PIN itself
tda-dsc-signer pin forget --all # remove it againSign the PDF
For a visible signature, give a page and a box. The box is two corners in PDF points, measured from the bottom left, and page -1 means the last page.
tda-dsc-signer sign report.pdf -p 1 -b 50,50,300,120
tda-dsc-signer sign report.pdf --invisible -o quiet.pdfPrefer a window? Run tda-dsc-signer, draw the box, pick the signer.

For an MCA style form with empty signature fields, look first and sign second:
tda-dsc-signer fields form.pdf
tda-dsc-signer sign form.pdf --all-fields--all-fields signs the fields whose PAN matches an attached token and lists the rest for the next person, who signs the file you saved.
The thing to keep straight is which file travels. Send the saved output onward, not the original, or the next copy arrives without the first signature. Your input is never modified, and an existing output is left alone unless you add --force.
Check what you made
After signing, whether the document is unmodified, whether the signature is valid and whether the issuer is trusted are reported separately. Treat them as separate questions, because a file can pass one and fail another.
| Exit code | Meaning |
|---|---|
| 0 | success |
| 1 | a doctor check failed, or the command ended in an error |
| 2 | signing ran, verification afterwards failed (a mistyped option also exits 2) |
| 3 | another copy of the signer holds the driver |
For a second opinion from Poppler, create the signer’s private trust database, which holds the pinned CCA India root, and point pdfsig at it:
tda-dsc-signer trust install
pdfsig -nssdir ~/.local/share/tda-dsc-signer/nssdb report-signed.pdfTwo things this walkthrough cannot promise. Acceptance by the MCA portal, and the format it expects, are not verified. How Adobe Acrobat displays trust is not verified either, since it keeps its own list. Check that a signed file meets the needs of whoever receives it, ideally before the deadline and not on it.