Commit Graph

13 Commits

Author SHA1 Message Date
Jack Grigg 5b44faec44 Refactors for reusability across supported recipients 2025-12-21 11:15:40 +00:00
Jack Grigg 45f6580be4 Request PIN before certificate generation if PIN policy is "always"
We also correctly ask for a PIN touch after the key is generated (which
does not need it) but before certificate generation (which does if the
touch policy is not "none").

Closes str4d/age-plugin-yubikey#101.
2023-01-03 02:20:51 +00:00
Jack Grigg d8eb198e97 Move certificate parsing into Metadata::extract 2023-01-01 13:27:10 +00:00
Jack Grigg 493479344c De-duplicate parsing recipients from SubjectPublicKeyInfo 2022-12-31 12:49:44 +00:00
Jack Grigg f2237ed2a7 yubikey 0.4 2021-10-18 21:11:42 +01:00
Jack Grigg 399f0b4c11 Rename crate::yubikey to crate::key
So that it doesn't conflict with the renamed `yubikey` crate.
2021-10-18 21:07:23 +01:00
Jack Grigg acdbb79083 Use non-short flags as defaults for TUI
Closes str4d/age-plugin-yubikey#27.
2021-05-02 08:48:05 +12:00
Jack Grigg 64b0ab4e16 Add --list comments to identity output
This improves the output of --generate and --identity, as well as the
interactive TUI.

Closes str4d/age-plugin-yubikey#24.
2021-04-25 12:10:35 +12:00
Jack Grigg 63c8d6c303 Rename PLUGIN_NAME to BINARY_NAME 2021-04-12 22:31:46 +12:00
Jack Grigg 771cad885a Always use created date from YubiKey certificate 2021-04-12 18:22:54 +12:00
Jack Grigg f74dd2ec4b Fix clippy lints 2021-04-04 16:55:34 +12:00
Jack Grigg c7f173b43e Rework Recipient to wrap p256::PublicKey 2021-04-04 16:13:57 +12:00
Jack Grigg 850f96cd2c Implement --generate command
Includes logic to help users manage their keys:

- If the key is using a default PIN, we require the user to change it.
- We set the PUK equal to the PIN so the user doesn't need to remember
  them separately.
- We migrate the default management key to a new PIN-protected key.
2021-03-29 19:02:32 +13:00