From 1064d2e742431cc9487d1dcd2a441a93a2b6ab87 Mon Sep 17 00:00:00 2001 From: drduh Date: Sat, 10 May 2025 16:45:23 -0700 Subject: [PATCH] print configured id/key attributes --- scripts/generate.sh | 30 ++++++++++++++++++------------ 1 file 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 " } -export GNUPGHOME="$(get_temp_dir)" +get_key_type () { + # Returns key type and size. + printf "rsa2048" +} -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" - -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 () {