as far as I remember, in the beginning it was not neccessary to enter the smartcard PIN on EACH signing with HSM2 - only after a while not using.
But currently I have to enter the pin on each single signing.
Is there a solution to lock the smartcard after some minutes of not using instead of immediately?
using java, (PKCS#11) with OpenSC looks like it is also every time unlocking, but as there it is possible to put the pin into the commandline parameter, it is less a problem.
In Theorie you could configure in opensc.conf a pin caching and time to hold the pin. If thatās practical working need to be tested.
use_pin_caching = bool;
# Use PIN caching (Default: true)?
pin_cache_counter = num;
# How many times to use a PIN from cache before re-authenticating it (Default: `10`)?
pin_cache_ignore_user_consent = bool;
# Older PKCS#11 applications not supporting `CKA_ALWAYS_AUTHENTICATE` may need to set this to get signatures to work with some cards (Default: `false`).
Oh, and you should update to the newest OpenSC SW ( 20.x)
Looking at the debug logs, I see that PKCS15 framwork is reading this configuration, but it also looks like the pcsc reader is ignoring this ( and in addition e.g. enable a not available pin-pad )
No further suggestions from my side as I gave up using it due to banana software. I want to use it and not grow it. I was able to prevent the PIN question with the NK Pro using the macOS keychain and an scevent on macOS. But not with the HSM on a FreeBSD Sstem
In this example call the PIN can be automatically provided to the tool, but I do not see the details how yet by the -readpass switch from the environment variable PKCS11_PIN:
I am not sure how would this work⦠the library is initialized every time a new application is started, youād need to use something that signs multiple images at once in a loop.
Every time EXE is started the library is loaded again and has no idea that few minutes earlier another application was using smartcard.
thanks for your idea. Did not try that yet, as our build infrastructure is currently all on windows.
But I did not know that signing Windows applications on Linux is possible.
I am not sure how would this work⦠the library is initialized every time a new application is started, youād need to use something that signs multiple images at once in a loop.
But therefore there should be the pin caching feature in the settings, which does not work currently.
My current mechanism is I transfer the files to the sign server file by file and sign it file by file. A change by transferring all files first, then signing all and then sending all back could improve that, too. But would be a bigger change.
So a simple solving that pin caching would be easier (for me)⦠as it is a bug in OpenSC in my opinion.