diff options
author | 2025-05-10 16:45:23 -0700 | |
---|---|---|
committer | 2025-05-10 16:45:23 -0700 | |
commit | 1064d2e742431cc9487d1dcd2a441a93a2b6ab87 (patch) | |
tree | c66225836bb657c89c755cc0eda37a032de5d2f4 /scripts/generate.sh | |
parent | 4fe4b8c157fc758ae6e7490893822bdcf2f827f6 (diff) | |
download | YubiKey-Guide-1064d2e742431cc9487d1dcd2a441a93a2b6ab87.tar.gz YubiKey-Guide-1064d2e742431cc9487d1dcd2a441a93a2b6ab87.tar.zst YubiKey-Guide-1064d2e742431cc9487d1dcd2a441a93a2b6ab87.zip |
print configured id/key attributes
Diffstat (limited to '')
-rwxr-xr-x | scripts/generate.sh | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/scripts/generate.sh b/scripts/generate.sh index 55ecb76..58cb0c9 100755 --- a/scripts/generate.sh +++ b/scripts/generate.sh @@ -21,19 +21,15 @@ get_id_label () { printf "YubiKey User <yubikey@example.domain>" } -export GNUPGHOME="$(get_temp_dir)" - -cd "$GNUPGHOME" - -printf "set temp dir (path=%s)\n" "$(pwd)" - -export IDENTITY="$(get_id_label)" - -printf "set id (label=%s)\n" "$IDENTITY" - -export KEY_TYPE="rsa4096" +get_key_type () { + # Returns key type and size. + printf "rsa2048" +} -export KEY_EXPIRATION="2027-05-01" +get_key_expiration () { + # Returns key expiration date. + printf "2027-05-01" +} get_pass () { # Returns random passphrase. @@ -44,6 +40,16 @@ get_pass () { head -c ${PASS_LENGTH:-29} } +export GNUPGHOME="$(get_temp_dir)" +cd "$GNUPGHOME" +printf "set temp dir (path='%s')\n" "$(pwd)" + +export IDENTITY="$(get_id_label)" +export KEY_TYPE="$(get_key_type)" +export KEY_EXPIRATION="$(get_key_expiration)" +printf "set id (label='%s', type='%s', expire='%s')\n" \ + "$IDENTITY" "$KEY_TYPE" "$KEY_EXPIRATION" + export CERTIFY_PASS="$(get_pass)" gen_key_certify () { |