3blabs
April 21, 2026, 2:49pm
1
I’m trying to use a Nitrokey HSM2 with n-of-m public key auth in XCA.
It works the first time when I unlock the HSM with scsh3gui and generate the keys / certificates. But the next time I XCA does not find the private keys on the HSM anymore. I made sure the HSM is unlocked / authenticated, but I just get the error “could not find private key” when trying to use the key / certificate for anything.
I also tried to setup a new XCA database and reimport the keys from the HSM. Results in the same issue. Even if XCA just found and imported the key, I get the same error.
Any Ideas? It works fine If I use a PIN only for the private key. But thats not what I need.
saper
August 1, 2026, 7:44pm
2
A new session to the Nitrokey HSM will select a new application and this causes the existing “session” to be invalidated. While not necessarily a bug, I have described the drawbacks of this in
opened 04:12PM - 04 Nov 21 UTC
closed 11:05AM - 26 Jan 24 UTC
### Problem Description
This is not a bug, rather a question how to solve the… issue give the current OpenSC architecture.
I have submitted a preliminary patch to allow SmartCardHSM to be initialized with a transport PIN:
https://github.com/OpenSC/OpenSC/pull/2431
After the initialization is done the card is left open (authenticated) so any provisioning can be done before
the transport PIN needs to be changed.
This works if SCSH is used to set up the token.
But OpenSC commands cannot be used because most of them reset the card and select the application, which logs the card off and PIN has to be changes.
### Proposed Resolution
Inhibit full card reset and applet selection in certain cases, preferably without an extra command-line option.
### Steps to reproduce
1. Apply https://github.com/OpenSC/OpenSC/pull/2431 and rebuild
2. Run `./src/tools/sc-hsm-tool -XT --so-pin 3537363231383830 --pin 000000 -s 1` to re-initialize the token
3. Run `./src/tools/opensc-tool -s 00:20:00:81`
The last command returns the error which indicates that User PIN has to be changed:
```
Using reader with a card: Nitrokey Nitrokey HSM (DENK02006540000 ) 00 00
Sending: 00 20 00 81
Received (SW1=0x69, SW2=0x84)
```
### Expected result
1. One could argue that "opensc-tool -s" should really do what is asked for - only send the APDU required.
But running other tools, like unwrapping the keys with `sc-hsm-tool`, `pkcs11-tool` key generation, could possibly be made to work.
2. SCSH reports PIN status `90 00` if started after the initialization. Key management is possible from there.
### Logs
OpenSC debug from the "opensc-tool -s" execution
```text
P:6773; T:0x34391285760 17:10:56.553 [opensc-tool] ctx.c:853:sc_context_create: ===================================
P:6773; T:0x34391285760 17:10:56.553 [opensc-tool] ctx.c:854:sc_context_create: opensc version: 0.22.0
P:6773; T:0x34391285760 17:10:56.553 [opensc-tool] reader-pcsc.c:888:pcsc_init: PC/SC options: connect_exclusive=0 disconnect_action=0 transaction_end_action=0 reconnect_action=0 enable_pinpad=1 enable_pace=1
P:6773; T:0x34391285760 17:10:56.554 [opensc-tool] reader-pcsc.c:1388:pcsc_detect_readers: called
P:6773; T:0x34391285760 17:10:56.554 [opensc-tool] reader-pcsc.c:1401:pcsc_detect_readers: Probing PC/SC readers
P:6773; T:0x34391285760 17:10:56.554 [opensc-tool] reader-pcsc.c:1454:pcsc_detect_readers: Establish PC/SC context
P:6773; T:0x34391285760 17:10:56.554 [opensc-tool] reader-pcsc.c:1337:pcsc_add_reader: Adding new PC/SC reader 'Nitrokey Nitrokey HSM (DENK02006540000 ) 00 00'
P:6773; T:0x34391285760 17:10:56.554 [opensc-tool] reader-pcsc.c:362:refresh_attributes: Nitrokey Nitrokey HSM (DENK02006540000 ) 00 00 check
P:6773; T:0x34391285760 17:10:56.554 [opensc-tool] reader-pcsc.c:409:refresh_attributes: current state: 0x00000122
P:6773; T:0x34391285760 17:10:56.554 [opensc-tool] reader-pcsc.c:410:refresh_attributes: previous state: 0x00000000
P:6773; T:0x34391285760 17:10:56.554 [opensc-tool] reader-pcsc.c:464:refresh_attributes: card present, changed
P:6773; T:0x34391285760 17:10:56.554 [opensc-tool] reader-pcsc.c:1555:pcsc_detect_readers: Nitrokey Nitrokey HSM (DENK02006540000 ) 00 00:SCardConnect(SHARED): 0x00000000
P:6773; T:0x34391285760 17:10:56.554 [opensc-tool] reader-pcsc.c:1154:detect_reader_features: called
P:6773; T:0x34391285760 17:10:56.554 [opensc-tool] reader-pcsc.c:1156:detect_reader_features: Requesting reader features ...
P:6773; T:0x34391285760 17:10:56.554 [opensc-tool] reader-pcsc.c:1177:detect_reader_features: Reader feature 12 found
P:6773; T:0x34391285760 17:10:56.554 [opensc-tool] reader-pcsc.c:1084:part10_detect_max_data: get dwMaxAPDUDataSize property returned 65536
P:6773; T:0x34391285760 17:10:56.554 [opensc-tool] reader-pcsc.c:1287:detect_reader_features: Reader supports transceiving 65536 bytes of data
P:6773; T:0x34391285760 17:10:56.554 [opensc-tool] reader-pcsc.c:1123:part10_get_vendor_product: id_vendor=20a0 id_product=4230
P:6773; T:0x34391285760 17:10:56.555 [opensc-tool] reader-pcsc.c:1570:pcsc_detect_readers: returning with: 0 (Success)
P:6773; T:0x34391285760 17:10:56.555 [opensc-tool] sc.c:335:sc_detect_card_presence: called
P:6773; T:0x34391285760 17:10:56.555 [opensc-tool] reader-pcsc.c:474:pcsc_detect_card_presence: called
P:6773; T:0x34391285760 17:10:56.555 [opensc-tool] reader-pcsc.c:362:refresh_attributes: Nitrokey Nitrokey HSM (DENK02006540000 ) 00 00 check
P:6773; T:0x34391285760 17:10:56.556 [opensc-tool] reader-pcsc.c:387:refresh_attributes: returning with: 0 (Success)
P:6773; T:0x34391285760 17:10:56.556 [opensc-tool] reader-pcsc.c:479:pcsc_detect_card_presence: returning with: 5
P:6773; T:0x34391285760 17:10:56.556 [opensc-tool] sc.c:340:sc_detect_card_presence: returning with: 5
P:6773; T:0x34391285760 17:10:56.556 [opensc-tool] sc.c:335:sc_detect_card_presence: called
P:6773; T:0x34391285760 17:10:56.556 [opensc-tool] reader-pcsc.c:474:pcsc_detect_card_presence: called
P:6773; T:0x34391285760 17:10:56.556 [opensc-tool] reader-pcsc.c:362:refresh_attributes: Nitrokey Nitrokey HSM (DENK02006540000 ) 00 00 check
P:6773; T:0x34391285760 17:10:56.557 [opensc-tool] reader-pcsc.c:387:refresh_attributes: returning with: 0 (Success)
P:6773; T:0x34391285760 17:10:56.557 [opensc-tool] reader-pcsc.c:479:pcsc_detect_card_presence: returning with: 5
P:6773; T:0x34391285760 17:10:56.557 [opensc-tool] sc.c:340:sc_detect_card_presence: returning with: 5
P:6773; T:0x34391285760 17:10:56.557 [opensc-tool] card.c:254:sc_connect_card: called
P:6773; T:0x34391285760 17:10:56.557 [opensc-tool] reader-pcsc.c:608:pcsc_connect: called
P:6773; T:0x34391285760 17:10:56.557 [opensc-tool] reader-pcsc.c:362:refresh_attributes: Nitrokey Nitrokey HSM (DENK02006540000 ) 00 00 check
P:6773; T:0x34391285760 17:10:56.558 [opensc-tool] reader-pcsc.c:387:refresh_attributes: returning with: 0 (Success)
P:6773; T:0x34391285760 17:10:56.558 [opensc-tool] reader-pcsc.c:640:pcsc_connect: Initial protocol: T=1
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1230:match_atr_table: ATR : 3b:de:18:ff:81:91:fe:1f:c3:80:31:81:54:48:53:4d:31:73:80:21:40:81:07:1c
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1241:match_atr_table: ATR try : 3b:d2:18:00:81:31:fe:58:c9:03:16
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1244:match_atr_table: ignored - wrong length
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1230:match_atr_table: ATR : 3b:de:18:ff:81:91:fe:1f:c3:80:31:81:54:48:53:4d:31:73:80:21:40:81:07:1c
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1241:match_atr_table: ATR try : 3B:DD:18:00:81:31:FE:45:80:F9:A0:00:00:00:77:01:00:70:0A:90:00:8B
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1244:match_atr_table: ignored - wrong length
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1230:match_atr_table: ATR : 3b:de:18:ff:81:91:fe:1f:c3:80:31:81:54:48:53:4d:31:73:80:21:40:81:07:1c
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1241:match_atr_table: ATR try : 3B:7F:96:00:00:00:31:B9:64:40:70:14:10:73:94:01:80:82:90:00
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1244:match_atr_table: ignored - wrong length
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1241:match_atr_table: ATR try : 3B:7F:96:00:00:00:31:B8:64:40:70:14:10:73:94:01:80:82:90:00
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1244:match_atr_table: ignored - wrong length
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1241:match_atr_table: ATR try : 3B:DF:18:FF:81:91:FE:1F:C3:00:31:B8:64:0C:01:EC:C1:73:94:01:80:82:90:00:B3
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1244:match_atr_table: ignored - wrong length
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1241:match_atr_table: ATR try : 3B:DC:18:FF:81:91:FE:1F:C3:80:73:C8:21:13:66:01:0B:03:52:00:05:38
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1244:match_atr_table: ignored - wrong length
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1230:match_atr_table: ATR : 3b:de:18:ff:81:91:fe:1f:c3:80:31:81:54:48:53:4d:31:73:80:21:40:81:07:1c
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1241:match_atr_table: ATR try : 3B:FE:18:00:00:81:31:FE:45:80:31:81:54:48:53:4D:31:73:80:21:40:81:07:FA
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1241:match_atr_table: ATR try : 3B:8E:80:01:80:31:81:54:48:53:4D:31:73:80:21:40:81:07:18
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1244:match_atr_table: ignored - wrong length
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1241:match_atr_table: ATR try : 3b:de:18:ff:81:91:fe:1f:c3:80:31:81:54:48:53:4d:31:73:80:21:40:81:07:1c
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1230:match_atr_table: ATR : 3b:de:18:ff:81:91:fe:1f:c3:80:31:81:54:48:53:4d:31:73:80:21:40:81:07:1c
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1241:match_atr_table: ATR try : 3B:FE:18:00:00:81:31:FE:45:80:31:81:54:48:53:4D:31:73:80:21:40:81:07:FA
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1241:match_atr_table: ATR try : 3B:8E:80:01:80:31:81:54:48:53:4D:31:73:80:21:40:81:07:18
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1244:match_atr_table: ignored - wrong length
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1241:match_atr_table: ATR try : 3B:DE:18:FF:81:91:FE:1F:C3:80:31:81:54:48:53:4D:31:73:80:21:40:81:07:1C
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] reader-pcsc.c:654:pcsc_connect: Final protocol: T=1
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:279:sc_connect_card: matching configured ATRs
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:288:sc_connect_card: trying driver 'cardos'
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1230:match_atr_table: ATR : 3b:de:18:ff:81:91:fe:1f:c3:80:31:81:54:48:53:4d:31:73:80:21:40:81:07:1c
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1241:match_atr_table: ATR try : 3b:d2:18:00:81:31:fe:58:c9:03:16
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1244:match_atr_table: ignored - wrong length
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:288:sc_connect_card: trying driver 'authentic'
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1230:match_atr_table: ATR : 3b:de:18:ff:81:91:fe:1f:c3:80:31:81:54:48:53:4d:31:73:80:21:40:81:07:1c
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1241:match_atr_table: ATR try : 3B:DD:18:00:81:31:FE:45:80:F9:A0:00:00:00:77:01:00:70:0A:90:00:8B
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1244:match_atr_table: ignored - wrong length
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:288:sc_connect_card: trying driver 'iasecc'
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1230:match_atr_table: ATR : 3b:de:18:ff:81:91:fe:1f:c3:80:31:81:54:48:53:4d:31:73:80:21:40:81:07:1c
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1241:match_atr_table: ATR try : 3B:7F:96:00:00:00:31:B9:64:40:70:14:10:73:94:01:80:82:90:00
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1244:match_atr_table: ignored - wrong length
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1241:match_atr_table: ATR try : 3B:7F:96:00:00:00:31:B8:64:40:70:14:10:73:94:01:80:82:90:00
P:6773; T:0x34391285760 17:10:56.559 [opensc-tool] card.c:1244:match_atr_table: ignored - wrong length
P:6773; T:0x34391285760 17:10:56.560 [opensc-tool] card.c:1241:match_atr_table: ATR try : 3B:DF:18:FF:81:91:FE:1F:C3:00:31:B8:64:0C:01:EC:C1:73:94:01:80:82:90:00:B3
P:6773; T:0x34391285760 17:10:56.560 [opensc-tool] card.c:1244:match_atr_table: ignored - wrong length
P:6773; T:0x34391285760 17:10:56.560 [opensc-tool] card.c:1241:match_atr_table: ATR try : 3B:DC:18:FF:81:91:FE:1F:C3:80:73:C8:21:13:66:01:0B:03:52:00:05:38
P:6773; T:0x34391285760 17:10:56.560 [opensc-tool] card.c:1244:match_atr_table: ignored - wrong length
P:6773; T:0x34391285760 17:10:56.560 [opensc-tool] card.c:288:sc_connect_card: trying driver 'sc-hsm'
P:6773; T:0x34391285760 17:10:56.560 [opensc-tool] card.c:1230:match_atr_table: ATR : 3b:de:18:ff:81:91:fe:1f:c3:80:31:81:54:48:53:4d:31:73:80:21:40:81:07:1c
P:6773; T:0x34391285760 17:10:56.560 [opensc-tool] card.c:1241:match_atr_table: ATR try : 3B:FE:18:00:00:81:31:FE:45:80:31:81:54:48:53:4D:31:73:80:21:40:81:07:FA
P:6773; T:0x34391285760 17:10:56.560 [opensc-tool] card.c:1241:match_atr_table: ATR try : 3B:8E:80:01:80:31:81:54:48:53:4D:31:73:80:21:40:81:07:18
P:6773; T:0x34391285760 17:10:56.560 [opensc-tool] card.c:1244:match_atr_table: ignored - wrong length
P:6773; T:0x34391285760 17:10:56.560 [opensc-tool] card.c:1241:match_atr_table: ATR try : 3b:de:18:ff:81:91:fe:1f:c3:80:31:81:54:48:53:4d:31:73:80:21:40:81:07:1c
P:6773; T:0x34391285760 17:10:56.560 [opensc-tool] card.c:293:sc_connect_card: matched driver 'SmartCard-HSM'
P:6773; T:0x34391285760 17:10:56.560 [opensc-tool] card.c:1230:match_atr_table: ATR : 3b:de:18:ff:81:91:fe:1f:c3:80:31:81:54:48:53:4d:31:73:80:21:40:81:07:1c
P:6773; T:0x34391285760 17:10:56.560 [opensc-tool] card.c:1241:match_atr_table: ATR try : 3B:FE:18:00:00:81:31:FE:45:80:31:81:54:48:53:4D:31:73:80:21:40:81:07:FA
P:6773; T:0x34391285760 17:10:56.560 [opensc-tool] card.c:1241:match_atr_table: ATR try : 3B:8E:80:01:80:31:81:54:48:53:4D:31:73:80:21:40:81:07:18
P:6773; T:0x34391285760 17:10:56.560 [opensc-tool] card.c:1244:match_atr_table: ignored - wrong length
P:6773; T:0x34391285760 17:10:56.560 [opensc-tool] card.c:1241:match_atr_table: ATR try : 3B:DE:18:FF:81:91:FE:1F:C3:80:31:81:54:48:53:4D:31:73:80:21:40:81:07:1C
P:6773; T:0x34391285760 17:10:56.560 [opensc-tool] card-sc-hsm.c:1617:sc_hsm_init: called
P:6773; T:0x34391285760 17:10:56.560 [opensc-tool] apdu.c:548:sc_transmit_apdu: called
P:6773; T:0x34391285760 17:10:56.560 [opensc-tool] card.c:473:sc_lock: called
P:6773; T:0x34391285760 17:10:56.560 [opensc-tool] reader-pcsc.c:687:pcsc_lock: called
P:6773; T:0x34391285760 17:10:56.560 [opensc-tool] card.c:513:sc_lock: returning with: 0 (Success)
P:6773; T:0x34391285760 17:10:56.560 [opensc-tool] apdu.c:515:sc_transmit: called
P:6773; T:0x34391285760 17:10:56.560 [opensc-tool] apdu.c:363:sc_single_transmit: called
P:6773; T:0x34391285760 17:10:56.560 [opensc-tool] apdu.c:367:sc_single_transmit: CLA:0, INS:A4, P1:4, P2:0, data(11) 0x7fffffffda30
P:6773; T:0x34391285760 17:10:56.560 [opensc-tool] reader-pcsc.c:325:pcsc_transmit: reader 'Nitrokey Nitrokey HSM (DENK02006540000 ) 00 00'
P:6773; T:0x34391285760 17:10:56.560 [opensc-tool] reader-pcsc.c:326:pcsc_transmit:
Outgoing APDU (17 bytes):
00 A4 04 00 0B E8 2B 06 01 04 01 81 C3 1F 02 01 ......+.........
00 .
P:6773; T:0x34391285760 17:10:56.560 [opensc-tool] reader-pcsc.c:244:pcsc_internal_transmit: called
P:6773; T:0x34391285760 17:10:56.598 [opensc-tool] reader-pcsc.c:335:pcsc_transmit:
Incoming APDU (14 bytes):
6F 0A 82 01 78 85 05 00 03 05 03 05 90 00 o...x.........
P:6773; T:0x34391285760 17:10:56.598 [opensc-tool] apdu.c:382:sc_single_transmit: returning with: 0 (Success)
P:6773; T:0x34391285760 17:10:56.598 [opensc-tool] apdu.c:537:sc_transmit: returning with: 0 (Success)
P:6773; T:0x34391285760 17:10:56.598 [opensc-tool] card.c:523:sc_unlock: called
P:6773; T:0x34391285760 17:10:56.598 [opensc-tool] reader-pcsc.c:739:pcsc_unlock: called
P:6773; T:0x34391285760 17:10:56.598 [opensc-tool] iso7816.c:366:iso7816_process_fci: shareable: yes
P:6773; T:0x34391285760 17:10:56.598 [opensc-tool] iso7816.c:386:iso7816_process_fci: type: DF
P:6773; T:0x34391285760 17:10:56.598 [opensc-tool] iso7816.c:387:iso7816_process_fci: EF structure: 0
P:6773; T:0x34391285760 17:10:56.598 [opensc-tool] iso7816.c:388:iso7816_process_fci: tag 0x82: 0x78
P:6773; T:0x34391285760 17:10:56.598 [opensc-tool] card.c:382:sc_connect_card: card info name:'SmartCard-HSM version 3.5', type:26000, flags:0x0, max_send/recv_size:1215/65536
P:6773; T:0x34391285760 17:10:56.598 [opensc-tool] card.c:1606:sc_card_sm_check: called
P:6773; T:0x34391285760 17:10:56.598 [opensc-tool] card.c:1230:match_atr_table: ATR : 3b:de:18:ff:81:91:fe:1f:c3:80:31:81:54:48:53:4d:31:73:80:21:40:81:07:1c
P:6773; T:0x34391285760 17:10:56.598 [opensc-tool] card.c:1241:match_atr_table: ATR try : 3B:FE:18:00:00:81:31:FE:45:80:31:81:54:48:53:4D:31:73:80:21:40:81:07:FA
P:6773; T:0x34391285760 17:10:56.599 [opensc-tool] card.c:1241:match_atr_table: ATR try : 3B:8E:80:01:80:31:81:54:48:53:4D:31:73:80:21:40:81:07:18
P:6773; T:0x34391285760 17:10:56.599 [opensc-tool] card.c:1244:match_atr_table: ignored - wrong length
P:6773; T:0x34391285760 17:10:56.599 [opensc-tool] card.c:1241:match_atr_table: ATR try : 3b:de:18:ff:81:91:fe:1f:c3:80:31:81:54:48:53:4d:31:73:80:21:40:81:07:1c
P:6773; T:0x34391285760 17:10:56.599 [opensc-tool] card.c:1614:sc_card_sm_check: returning with: 0 (Success)
P:6773; T:0x34391285760 17:10:56.599 [opensc-tool] card.c:397:sc_connect_card: returning with: 0 (Success)
P:6773; T:0x34391285760 17:10:56.599 [opensc-tool] apdu.c:669:sc_bytes2apdu: CASE_1 APDU: 4 bytes: ins=20 p1=00 p2=81 lc=0000 le=0000
P:6773; T:0x34391285760 17:10:56.599 [opensc-tool] card.c:473:sc_lock: called
P:6773; T:0x34391285760 17:10:56.599 [opensc-tool] reader-pcsc.c:687:pcsc_lock: called
P:6773; T:0x34391285760 17:10:56.599 [opensc-tool] card.c:513:sc_lock: returning with: 0 (Success)
P:6773; T:0x34391285760 17:10:56.599 [opensc-tool] apdu.c:548:sc_transmit_apdu: called
P:6773; T:0x34391285760 17:10:56.599 [opensc-tool] card.c:473:sc_lock: called
P:6773; T:0x34391285760 17:10:56.599 [opensc-tool] card.c:513:sc_lock: returning with: 0 (Success)
P:6773; T:0x34391285760 17:10:56.599 [opensc-tool] apdu.c:515:sc_transmit: called
P:6773; T:0x34391285760 17:10:56.599 [opensc-tool] apdu.c:363:sc_single_transmit: called
P:6773; T:0x34391285760 17:10:56.599 [opensc-tool] apdu.c:367:sc_single_transmit: CLA:0, INS:20, P1:0, P2:81, data(0) 0x0
P:6773; T:0x34391285760 17:10:56.599 [opensc-tool] reader-pcsc.c:325:pcsc_transmit: reader 'Nitrokey Nitrokey HSM (DENK02006540000 ) 00 00'
P:6773; T:0x34391285760 17:10:56.599 [opensc-tool] reader-pcsc.c:326:pcsc_transmit:
Outgoing APDU (4 bytes):
00 20 00 81 . ..
P:6773; T:0x34391285760 17:10:56.599 [opensc-tool] reader-pcsc.c:244:pcsc_internal_transmit: called
P:6773; T:0x34391285760 17:10:56.628 [opensc-tool] reader-pcsc.c:335:pcsc_transmit:
Incoming APDU (2 bytes):
69 84 i.
P:6773; T:0x34391285760 17:10:56.628 [opensc-tool] apdu.c:382:sc_single_transmit: returning with: 0 (Success)
P:6773; T:0x34391285760 17:10:56.628 [opensc-tool] apdu.c:537:sc_transmit: returning with: 0 (Success)
P:6773; T:0x34391285760 17:10:56.628 [opensc-tool] card.c:523:sc_unlock: called
P:6773; T:0x34391285760 17:10:56.628 [opensc-tool] card.c:523:sc_unlock: called
P:6773; T:0x34391285760 17:10:56.628 [opensc-tool] reader-pcsc.c:739:pcsc_unlock: called
P:6773; T:0x34391285760 17:10:56.628 [opensc-tool] card.c:414:sc_disconnect_card: called
P:6773; T:0x34391285760 17:10:56.628 [opensc-tool] reader-pcsc.c:672:pcsc_disconnect: Nitrokey Nitrokey HSM (DENK02006540000 ) 00 00:SCardDisconnect returned: 0x00000000
P:6773; T:0x34391285760 17:10:56.628 [opensc-tool] card.c:436:sc_disconnect_card: returning with: 0 (Success)
P:6773; T:0x34391285760 17:10:56.628 [opensc-tool] ctx.c:929:sc_release_context: called
P:6773; T:0x34391285760 17:10:56.628 [opensc-tool] reader-pcsc.c:976:pcsc_finish: called
```
Unless XCA can support Nitrokey’s n-of-m scheme this might be hard to get working.
sc-hsm
August 1, 2026, 8:02pm
3
We are working on a Cloud-HSM integration for the sc-hsm-pkcs11 module. That way you can define an URL to which the PKCS#11 module will connect in the C_Login call. In the web-service at the other end you can perform public key authentication and enabled access to the device. When you disconnect the token from the web-service, the PKCS#11 processing will continue.
We will post here, when that function is available.
3blabs
August 5, 2026, 7:21am
4
If I understand corrctly, openssl / XCA are currently unusable. - So what solution can be used to manage a PKI with n-of-m on Nitrokey HSM?
sc-hsm
August 5, 2026, 7:26am
5