+ local returnCode
+
+ # default return code is 0, which assumes a key was found for
+ # every host. code will be set to 1 if a key is not found for at
+ # least one host
+ returnCode=0
+
+ # take all the hosts from the known_hosts file (first field), grep
+ # out all the hashed hosts (lines starting with '|')...
+ for line in $(cat "$KNOWN_HOSTS" | meat | cut -d ' ' -f 1 | grep -v '^|.*$') ; do
+ # break up hosts into separate words
+ update_known_hosts $(echo "$line" | tr , ' ') || returnCode=1
+ done
+
+ return "$returnCode"
+}
+
+# process uids for the authorized_keys file
+process_uid_authorized_keys() {
+ local userID
+ local ok
+ local keyid
+ local returnCode
+
+ # default return code is 1, which assumes no key was found
+ returnCode=1
+
+ userID="$1"
+
+ log "processing user ID: $userID"
+
+ for line in $(process_user_id "$userID") ; do
+ ok=$(echo "$line" | cut -d: -f1)
+ keyid=$(echo "$line" | cut -d: -f2)
+
+ sshKey=$(gpg2ssh "$keyid")
+ # remove the old host key line
+ remove_line "$AUTHORIZED_KEYS" "$sshKey"
+ # if key OK, add new host line
+ if [ "$ok" -eq '0' ] ; then
+ ssh2authorized_keys "$userID" "$sshKey" >> "$AUTHORIZED_KEYS"
+
+ # set return code to be 0, since a key was found
+ returnCode=0
+ fi
+ done
+
+ return "$returnCode"
+}