Skip to content

DRAFT: Yubikey Enhancements - #509

Draft
Fahrj wants to merge 16 commits into
Foxboron:masterfrom
Fahrj:yubikey_enhancements-split-additions
Draft

DRAFT: Yubikey Enhancements#509
Fahrj wants to merge 16 commits into
Foxboron:masterfrom
Fahrj:yubikey_enhancements-split-additions

Conversation

@Fahrj

@Fahrj Fahrj commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

This PR builds on the work of @bsingh-kpt in #474, but additionally fixes some bugs and adds more features.

The commits are separated in a best effort attempt to distinguish different features and fixes.

Most significant features:

  1. Support for RSA2048 and RSA3072 (thus support for YubiKeys <5.7)
  2. Support to specify PIV slots
  3. PIV certificate will be re-used and stored on the YubiKey

Closes #471

bsingh-kpt and others added 13 commits August 20, 2026 14:07
This commit serves as preparation for the handling of custom algorithms
and slot numbers.
When creating new key, the options such as PIN policy only have to be
provided, but not to be applied.
If the certificate only exists on disk, it is essentially bound to that
machine. By storing in on the YubiKey directly, it can easily be reused.
Depending on the YubiKey Version, either `KeyInfo` or the attestation
certificate are used to get the key's public bytes, if existing.
If key or cert are already present in the given YubiKey PIV slot, they
are re-used unless `yk-overwrite` is given on the CLI.
When loading key data from disk, immediately verify whether the
certificate is signed by the specified private key.
This e.g. catches if the wrong YubiKey is inserted.
@Fahrj
Fahrj force-pushed the yubikey_enhancements-split-additions branch from 4ea7414 to 1c0fd82 Compare August 20, 2026 12:12
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 this pull request may close these issues.

Yubikey Firmware < 5.7 don't support RSA4096 for key creation

2 participants