# PKCS11 / OpenSSL and n-of-m

**URL:** <https://support.nitrokey.com/t/pkcs11-openssl-and-n-of-m/7638>\
**Category:** HSM\
**Created:** [June 8, 2026, 2:49pm UTC](https://support.nitrokey.com/t/pkcs11-openssl-and-n-of-m/7638 "2026-06-08T14:49:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![3blabs](https://support.nitrokey.com/letter_avatar_proxy/v4/letter/3/5f9b8f/32.png) [@3blabs](https://support.nitrokey.com/u/3blabs)\
**Post date:** [June 8, 2026, 2:49pm UTC](https://support.nitrokey.com/t/pkcs11-openssl-and-n-of-m/7638/1 "2026-06-08T14:49:58Z")

</div>

I’mt trying to get a setup with two Nitrokeys HSM automated.  
HSM A contains the “root” key and is locked by a 2-of-3 scheme.

Currently I’m trying to setup openssl with PKCS11.  
pkcs11-tool only detects the first key / slot on the device (–list-slots).  
Is there any way pkcs11-tool finds all keys? - It does find all pub-keys and certificates on it (–list-objects). - Or is there some kind of alternative to use keys?

EDIT:  
not even the slot which is displayed by pkcs11-tool is usable.  
openssl […] -key key-uri-give-by-pkcs11-tool  
returns “Could not find private key” - even if the HSM is unlocked. Trying the same command with a HSM only locked by a PIN works fine.

---

<div class="post-metadata">

**Author:** ![nku](https://support.nitrokey.com/letter_avatar_proxy/v4/letter/n/2bfe46/32.png) [@nku](https://support.nitrokey.com/u/nku)\
**Post date:** [June 9, 2026, 3:56pm UTC](https://support.nitrokey.com/t/pkcs11-openssl-and-n-of-m/7638/2 "2026-06-09T15:56:58Z")

</div>

Did you try to setup hte HSM using the [SmartCardShell](https://www.openscdp.org/scsh3/index.html)?

---

<div class="post-metadata">

**Author:** ![3blabs](https://support.nitrokey.com/letter_avatar_proxy/v4/letter/3/5f9b8f/32.png) [@3blabs](https://support.nitrokey.com/u/3blabs)\
**Post date:** [June 9, 2026, 7:13pm UTC](https://support.nitrokey.com/t/pkcs11-openssl-and-n-of-m/7638/3 "2026-06-09T19:13:15Z")

</div>

Yes that works. Including the SCSH3gui - But as far as I understand that software can not create or sign certificates.

---

<div class="post-metadata">

**Author:** ![saper](https://support.nitrokey.com/user_avatar/support.nitrokey.com/saper/32/493_2.png) [@saper](https://support.nitrokey.com/u/saper)\
**Post date:** [August 1, 2026, 7:32pm UTC](https://support.nitrokey.com/t/pkcs11-openssl-and-n-of-m/7638/4 "2026-08-01T19:32:27Z")

</div>

> [@3blabs](#):
>
> pkcs11-tool only detects the first key / slot on the device (–list-slots).

This is correct. One Nitrokey HSM is one slot. So `--list-slots` should show one entry for your Nitrokey HSM. You can use the slot number in the further commands if you have multiple devices attached.

> [@3blabs](#):
>
> It does find all pub-keys and certificates on it (–list-objects).

This is also correct. Please add `--login` option and provide a PIN and the private keys will be displayed, too.

---

<div class="post-metadata">

**Author:** ![sc-hsm](https://support.nitrokey.com/user_avatar/support.nitrokey.com/sc-hsm/32/304_2.png) [@sc-hsm](https://support.nitrokey.com/u/sc-hsm)\
**Post date:** [August 1, 2026, 8:03pm UTC](https://support.nitrokey.com/t/pkcs11-openssl-and-n-of-m/7638/5 "2026-08-01T20:03:50Z")

</div>

See [Nitrokey HSM, n-of-m scheme and XCA - #3 by sc-hsm](https://support.nitrokey.com/t/nitrokey-hsm-n-of-m-scheme-and-xca/7582/3)
