+
+ # output the server fingerprint
+ fingerprint_server_key "=${userID}"
+
+ # find the key fingerprint of the server primary key
+ keyID=$(gpg --list-key --with-colons --with-fingerprint "=${userID}" | \
+ grep '^fpr:' | head -1 | cut -d: -f10)
+
+ # write the key to the file
+ # NOTE: assumes that the primary key is the proper key to use
+ (umask 077 && gpgsecret2ssh "$keyID" > "${MS_HOME}/ssh_host_rsa_key")
+ log "Private SSH host key output to file: ${MS_HOME}/ssh_host_rsa_key"
+}
+
+# gpg output key fingerprint
+fingerprint_server_key() {
+ local ID
+
+ if [ -z "$1" ] ; then
+ ID="$1"
+ else
+ ID="=ssh://$(hostname --fqdn)"
+ fi
+
+ gpg --fingerprint --list-secret-keys "$ID"