OiO.lk Blog pdf Digital signature to PDF file – pkcs11.dll not detected from the system (windows-`10)
pdf

Digital signature to PDF file – pkcs11.dll not detected from the system (windows-`10)


I want to sign a PDF file using a digital signature from a USB token (containing the private and public keys). When I try to achieve this using PKCS11.dll, the system detects an error and throws a ‘module could not be found’ error.

C:\Windows\System32\pkcs11.dll
Error loading PKCS#11 library: Cannot open library at C:\Windows\System32\pkcs11.dll: The specified module could not be found.

My Code:

import os
import pkcs11

Path to the PKCS#11 library (update this path accordingly)

pkcs11_lib_path = r’C:\Windows\System32\pkcs11.dll’ # or SysWOW64 for 32-bit
print(pkcs11_lib_path)

Initialize the PKCS#11 library

try:
lib = pkcs11.lib(pkcs11_lib_path)
except Exception as e:
print(f"Error loading PKCS#11 library: {e}")
exit(1)

I tried my code block above mentioned



You need to sign in to view this answers

Exit mobile version