summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/ChangeLog5
-rwxr-xr-xtools/gpgsm-gencert.sh20
2 files changed, 20 insertions, 5 deletions
diff --git a/tools/ChangeLog b/tools/ChangeLog
index e1dfce49d..7dc6d512e 100644
--- a/tools/ChangeLog
+++ b/tools/ChangeLog
@@ -1,3 +1,8 @@
+2005-08-01 Werner Koch <wk@g10code.com>
+
+ * gpgsm-gencert.sh: Allow entering a keygrip to generate a CSR from
+ an existing key.
+
2005-07-21 Werner Koch <wk@g10code.com>
* gpgsm-gencert.sh: Reworked to allow for multiple email addresses
diff --git a/tools/gpgsm-gencert.sh b/tools/gpgsm-gencert.sh
index 44b06f3b3..3949f2361 100755
--- a/tools/gpgsm-gencert.sh
+++ b/tools/gpgsm-gencert.sh
@@ -84,11 +84,20 @@ query_user_menu()
echo "You selected: $ANSWER" >&2
}
-query_user_menu "Key type" "RSA"
-KEY_TYPE=$ANSWER
+query_user_menu "Key type" "RSA" "existing key"
+if [ "$ANSWER" = "existing key" ]; then
+ # User requested to use an existing key; need to set some dummy defaults
+ KEY_TYPE=RSA
+ KEY_LENGTH=1024
+ query_user "Keygrip "
+ KEY_GRIP=$ANSWER
+else
+ KEY_TYPE=$ANSWER
+ query_user_menu "Key length" "1024" "2048"
+ KEY_LENGTH=$ANSWER
+ KEY_GRIP=
+fi
-query_user_menu "Key length" "1024" "2048"
-KEY_LENGTH=$ANSWER
query_user_menu "Key usage" "sign, encrypt" "sign" "encrypt"
KEY_USAGE=$ANSWER
@@ -137,6 +146,7 @@ Key-Length: $KEY_LENGTH
Key-Usage: $KEY_USAGE
Name-DN: $NAME
EOF
+[ -n "$KEY_GRIP" ] && echo "Key-Grip: $KEY_GRIP"
[ -n "$EMAIL_ADDRESSES" ] && echo "$EMAIL_ADDRESSES"
[ -n "$DNS_ADDRESSES" ] && echo "$DNS_ADDRESSES"
[ -n "$URI_ADDRESSES" ] && echo "$URI_ADDRESSES"
@@ -152,7 +162,7 @@ query_user_menu "Really create such a CSR?" "yes" "no"
echo -e "$ASSUAN_COMMANDS" | \
- ./gpgsm --no-log-file --debug-level none --debug-none \
+ gpgsm --no-log-file --debug-level none --debug-none \
--server 4< "$file_parameter" 5>"$outfile" >/dev/null
cat "$outfile"