Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkcs11-tool should provide an option to get slot information as pkcs11-uri #3123

Closed
sarroutbi opened this issue Apr 18, 2024 · 1 comment · Fixed by #3125
Closed

pkcs11-tool should provide an option to get slot information as pkcs11-uri #3123

sarroutbi opened this issue Apr 18, 2024 · 1 comment · Fixed by #3125

Comments

@sarroutbi
Copy link
Contributor

Problem Description

It would be great if pkcs11-tool could include a function to dump slot information as a PKCS#11 URI

Proposed Resolution

pkcs11-tool already dumps information related to each of the detected devices. For example:

$ pkcs11-tool -L
Available slots:
Slot 0 (0x0): Yubico YubiKey OTP+CCID 00 00
  token label        : clevis
  token manufacturer : piv_II
  token model        : PKCS#15 emulated
  token flags        : login required, rng, token initialized, PIN initialized
  hardware version   : 0.0
  firmware version   : 0.0
  serial num         : 0123456789abcde
  pin min/max        : 4/8

An option like -u, --uri would be nice, to dump this information as a supported PKCS#11 URI:

$ pkcs11-tool -u
Slot 0 (0x0): Yubico YubiKey OTP+CCID 00 00: pkcs11:model=PKCS%2315%20emulated;manufacturer=piv_II;serial=0123456789abcde;token=clevis 
@Jakuje
Copy link
Member

Jakuje commented Apr 18, 2024

The PKCS#11 URI identifies not only the slots, but also objects, so if we should have it, I would say it should be just printed in the output where we list slots or objects. It has also several non-mandatory parts, such as PIN, module path, which should probably not be used in the default print.

$ pkcs11-tool -L
Available slots:
Slot 0 (0x0): Yubico YubiKey OTP+CCID 00 00
  token label        : clevis
  token manufacturer : piv_II
  token model        : PKCS#15 emulated
  token flags        : login required, rng, token initialized, PIN initialized
  hardware version   : 0.0
  firmware version   : 0.0
  serial num         : 0123456789abcde
  pin min/max        : 4/8
  uri:               : pkcs11:model=PKCS%2315%20emulated;manufacturer=piv_II;serial=0123456789abcde;token=clevis 

The reason why it was not implemented so far is likely nobody needed that so far. Every time I needed a PKCS#11 URI in the output, I usually used p11tool from gnutls or p11-kit, which prints these.

So if you are (or anyone else) interested in implementing this, we would be happy to accept patches.

sarroutbi added a commit to sarroutbi/OpenSC that referenced this issue Apr 19, 2024
Resolves: OpenSC#3123

Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
sarroutbi added a commit to sarroutbi/OpenSC that referenced this issue Apr 19, 2024
Resolves: OpenSC#3123

Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
sarroutbi added a commit to sarroutbi/OpenSC that referenced this issue Apr 19, 2024
Fixes: OpenSC#3123

Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
sarroutbi added a commit to sarroutbi/OpenSC that referenced this issue Apr 19, 2024
Fixes: OpenSC#3123

Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
sarroutbi added a commit to sarroutbi/OpenSC that referenced this issue Apr 19, 2024
Fixes: OpenSC#3123

Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
sarroutbi added a commit to sarroutbi/OpenSC that referenced this issue Apr 19, 2024
Fixes: OpenSC#3123

Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
sarroutbi added a commit to sarroutbi/OpenSC that referenced this issue Apr 19, 2024
Fixes: OpenSC#3123

Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
sarroutbi added a commit to sarroutbi/OpenSC that referenced this issue Apr 19, 2024
Fixes: OpenSC#3123

Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
sarroutbi added a commit to sarroutbi/OpenSC that referenced this issue Apr 19, 2024
Fixes: OpenSC#3123

Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
sarroutbi added a commit to sarroutbi/OpenSC that referenced this issue Apr 25, 2024
Fixes: OpenSC#3123

Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
sarroutbi added a commit to sarroutbi/OpenSC that referenced this issue Apr 25, 2024
Fixes: OpenSC#3123

Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
sarroutbi added a commit to sarroutbi/OpenSC that referenced this issue Apr 25, 2024
Fixes: OpenSC#3123

Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
sarroutbi added a commit to sarroutbi/OpenSC that referenced this issue Apr 25, 2024
Fixes: OpenSC#3123

Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
@Jakuje Jakuje closed this as completed in 5674ff6 Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants