diff options
-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 () { |