+}
+
+# command for edit key scripts, takes scripts on stdin
+# FIXME: should we supress all the edit script spew? or pipe it
+# through log debug?
+gpg_host_edit() {
+ gpg_host --quiet --command-fd 0 --edit-key \
+ "0x${HOST_FINGERPRINT}!" "$@"
+}
+
+# export the host public key to the monkeysphere gpg pub key file
+update_gpg_pub_file() {
+ log debug "updating openpgp public key file '$HOST_KEY_FILE'..."
+ gpg_host --export --armor --export-options export-minimal \
+ "0x${HOST_FINGERPRINT}!" > "$HOST_KEY_FILE"
+}
+
+# load the host fingerprint into the fingerprint variable, using the
+# export gpg pub key file
+# FIXME: this seems much less than ideal, with all this temp keyring
+# stuff. is there a way we can do this without having to create temp
+# files? what if we stored the fingerprint in MHDATADIR/fingerprint?
+load_fingerprint() {
+ if [ -f "$HOST_KEY_FILE" ] ; then
+ HOST_FINGERPRINT=$( \
+ (FUBAR=$(mktemp -d) && export GNUPGHOME="$FUBAR" \
+ && gpg --quiet --import \
+ && gpg --quiet --list-keys --with-colons --with-fingerprint \
+ && rm -rf "$FUBAR") <"$HOST_KEY_FILE" \
+ | grep '^fpr:' | cut -d: -f10 )