Using the winscard functionallity that came after wine 8.4/PKCS11 Smart Cards

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
illiyan
Newbie
Newbie
Posts: 1
Joined: Sat Aug 19, 2023 9:32 am

Using the winscard functionallity that came after wine 8.4/PKCS11 Smart Cards

Post by illiyan »

Hello,

I'm one of the people unfortunate enough to need to use PKCS#11 with a smart card and Adobe Acrobat Reader. I need to be able to fill in one of the dreadful xml forms in a PDF file with acrobat and then sign the file with a smart card. I did some research and I have been doing testing with wine-8.13 but I'm unable to make this work.

My smart card works perfectly fine under Linux with all my browsers and any other software that needs access to it through pcscd and opensc. The card is a Gemalto ID Prime 940. It works well with the OpenSC onepin library under linux, I'm able to login and even sign pdfs with pdfsig. Unfortunately using Acrobat DC under wine, filling in the PDF forms and then signing it with pdfsig is not an option as the structure of the pdf changes and then I cannot sign it properly with pdfsig, which makes it incompatible with the egov systems of the country I'm originally from.

I did a bit of digging and found out that Mounir IDRASSI had a working implementation of winscard for wine, and that his patches were finally implemented in wine-8.4. So I decided to try and use the latest wine on my system to make this work entirely with Acrobat DC under wine. Unfortunately I'm not able to achieve this.

My OS is Fedora 38, the wine that comes with it does not have winscard compiled in, I had to use copr to rebuild both the x86_64 and i686 versions of wine with winscard compiled in (I added pcsc-lite-libs-devel as dependency and edited the spec files). I have the winscard.dll and winscard.dll.so files with my updated wine-8.13, but I still can't make Acrobat under wine work with the smart card (or any other program that needs to communicate with the card).

As there isn't a lot of documentation, none actually, I would like to know what is the proper way of setting this up. My assumption was that winscard implementation of wine communicates directly with the running pcscd on Linux and I would just need a PKCS11 dll to communicate with the smart card. This however does not seem to work. I tried it both with the Gemalto card, but also with other cards made by Siemens (with the proper dlls). It still doesn't work. I'm running a clean wine env, winearch=win32, adobe acrobat installed in it, and all the packages with the DLLs for the smartcards. I load the smartcard dll as a provider in Acrobat, but I cannot login. I used other programs to try to communicate with the smartcards, where I can load the appropriate DLLs for the cards and login/logout and the certificates, but the furthest I can go is just see empty slots (this doesn't mean there is communication, the Gemalto DLL just preloads all the available slots)

What am I doing wrong? Based on the description in the changelog this seems to be implemented because of the certificates used in Germany and Italy(?) egovs, so it must be working. The proper setup is still a mystery though. Can someone help me with some directions? What am I forgetting. My assumption is that I don't need to install a driver for the ACR usb reader, as winscard communicates directly with pcscd, and pcscd already has a driver for the ACR, or am I wrong?
Locked