}
# generate a subkey with the 'a' usage flags set
-# FIXME: not working yet.
+# FIXME: this needs some tweaking to clean it up
gen_subkey(){
local keyID
local gpgOut
local userID
- log "warning: this function is still not working."
-
keyID="$1"
gpgOut=$(gpg --fixed-list-mode --list-keys --with-colons \
# return 1 if there only "tru" lines are output from gpg
if [ -z "$(echo "$gpgOut" | grep -v '^tru:')" ] ; then
- log " key not found."
- return 1
+ failure "Key ID '$keyID' not found."
fi
# set subkey defaults
for userID ; do
update_userid "$userID" "$userKeysCacheDir"
done
- log "run the following to update your monkeysphere authorized_keys file:"
+ log "Run the following to update your monkeysphere authorized_keys file:"
log "$PGRM update-authorized_keys"
;;
for userID ; do
remove_userid "$userID"
done
- log "run the following to update your monkeysphere authorized_keys file:"
+ log "Run the following to update your monkeysphere authorized_keys file:"
log "$PGRM update-authorized_keys"
;;
'gen-subkey'|'g')
keyID="$1"
if [ -z "$keyID" ] ; then
- failure "you must specify keyid of primary key."
+ failure "You must specify the key ID of your primary key."
fi
gen_subkey "$keyID"
;;
'trust-keys'|'trust-key'|'t')
if [ -z "$1" ] ; then
- failure "you must specify at least one key to trust."
+ failure "You must specify at least one key to trust."
fi
# process key IDs
uname="$1"
shift
if [ -z "$uname" ] ; then
- failure "you must specify user."
+ failure "You must specify user."
fi
if [ -z "$1" ] ; then
- failure "you must specify at least one userid."
+ failure "You must specify at least one user ID."
fi
# set variables for the user
update_userid "$userID" "$cacheDir"
done
- log "run the following to update user's authorized_keys file:"
+ log "Run the following to update user's authorized_keys file:"
log "$PGRM update-users $uname"
;;
uname="$1"
shift
if [ -z "$uname" ] ; then
- failure "you must specify user."
+ failure "You must specify user."
fi
if [ -z "$1" ] ; then
- failure "you must specify at least one userid."
+ failure "You must specify at least one user ID."
fi
# set variables for the user
remove_userid "$userID"
done
- log "run the following to update user's authorized_keys file:"
+ log "Run the following to update user's authorized_keys file:"
log "$PGRM update-users $uname"
;;