LudovicRousseau / PyKCS11

PKCS#11 Wrapper for Python
GNU General Public License v2.0
99 stars 35 forks source link

ACS ACR39U ICC Reader - newbie problem with using PyKCS11 #92

Closed sq5rix closed 3 years ago

sq5rix commented 3 years ago

Your system information

I installed my card reader: $ pkcs11-tool -L Available slots: Slot 0 (0x0): ACS ACR39U ICC Reader 00 00 (token not recognized)

also my pcsc_scan works: $ pcsc_scan Using reader plug'n play mechanism Scanning present readers... 0: ACS ACR39U ICC Reader 00 00 .... Possibly identified card (using /home/tom/.cache/smartcard_list.txt): 3B DD 96 FF 81 31 FE 45 80 59 5F 53 74 64 5F 49 6E 69 74 81 05 9B

I installed PyKCS11 from repo (make, sudo make install)

I tried to run this code:

import PyKCS11 pkcs11 = PyKCS11.PyKCS11Lib() pkcs11.load()

I get error: PyKCS11.PyKCS11Error: Load (No PKCS11 library specified (set PYKCS11LIB env variable))

Please point me what library should I install and use.

LudovicRousseau commented 3 years ago

Everything is in the error message: set PYKCS11LIB env variable See also https://pkcs11wrap.sourceforge.io/api/api.html?highlight=load#PyKCS11.PyKCS11Lib.load

If OpenSC does NOT recognize your card then PyKCS11 will not work.