Mi spiego.
Se carico il modulo "a manina" così:
Codice: Seleziona tutto
michelino:~$ openssl
OpenSSL> engine -t dynamic -pre SO_PATH:/usr/lib64/engines/engine_pkcs11.so -pre ID:pkcs11 -pre LIST_ADD:1 -pre LOAD -pre MODULE_PATH:/usr/lib64/libbit4ipki.soCodice: Seleziona tutto
(dynamic) Dynamic engine loading support
[Success]: SO_PATH:/usr/lib64/engines/engine_pkcs11.so
[Success]: ID:pkcs11
[Success]: LIST_ADD:1
[Success]: LOAD
[Success]: MODULE_PATH:/usr/lib64/libbit4ipki.so
Loaded: (pkcs11) pkcs11 engine
openssl (lock_dbg_cb): already locked (mode=9, type=30) at eng_list.c:284
openssl (lock_dbg_cb): not locked (mode=10, type=30) at eng_init.c:131
[ available ]
Codice: Seleziona tutto
OpenSSL> smime -nodetach -binary -outform DER -sign -signer michelino.pem -inkey id_xxxx -keyform engine -in prova.txt -out prova.p7m -engine pkcs11
Codice: Seleziona tutto
openssl-conf = openssl-def
[ openssl-def ]
engines = engine-section
[ engine-section ]
pkcs11 = pkcs11-section
[ pkcs11-section ]
engine-id = pkcs11
dynamic-path = /usr/lib64/engines/engine-pkcs11.so
MODULE-PATH = /usr/lib64/libbit4ipki.so
init = 0
Codice: Seleziona tutto
michelino:~$ openssl engine -t -v
(dynamic) Dynamic engine loading support
[ unavailable ]
SO_PATH, NO_VCHECK, ID, LIST_ADD, DIR_LOAD, DIR_ADD, LOAD
michelino:~$ openssl speed -engine pkcs11
invalid engine "pkcs11"
3395:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:162:filename(/usr/lib/engines/libpkcs11.so): /usr/lib/engines/libpkcs11.so: cannot open shared object file: No such file or directory
3395:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
3395:error:260B6084:engine routines:DYNAMIC_LOAD:dso not found:eng_dyn.c:450:
3395:error:2606A074:engine routines:ENGINE_by_id:no such engine:eng_list.c:415:id=pkcs11
3395:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:162:filename(libpkcs11.so): libpkcs11.so: cannot open shared object file: No such file or directory
3395:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
3395:error:260B6084:engine routines:DYNAMIC_LOAD:dso not found:eng_dyn.c:450:
Codice: Seleziona tutto
michelino:~$ openssl smime -engine pkcs11 -nodetach -binary -outform DER -sign -signer michelino.pem -inkey id_xxxx -keyform engine -in prova.txt -out prova.p7m
invalid engine "pkcs11"
3479:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:162:filename(/usr/lib/engines/libpkcs11.so): /usr/lib/engines/libpkcs11.so: cannot open shared object file: No such file or directory
3479:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
3479:error:260B6084:engine routines:DYNAMIC_LOAD:dso not found:eng_dyn.c:450:
3479:error:2606A074:engine routines:ENGINE_by_id:no such engine:eng_list.c:415:id=pkcs11
3479:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:162:filename(libpkcs11.so): libpkcs11.so: cannot open shared object file: No such file or directory
3479:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
3479:error:260B6084:engine routines:DYNAMIC_LOAD:dso not found:eng_dyn.c:450:
no engine specified
unable to load signing key file
