MHDATADIR="${SYSDATADIR}/host"
# host pub key files
-HOST_KEY_FILE="${SYSDATADIR}/host_keys.pub.gpg"
+HOST_KEY_FILE="${SYSDATADIR}/host_keys.pub.pgp"
# UTC date in ISO 8601 format if needed
DATE=$(date -u '+%FT%T')
gpg_host --command-fd 0 --edit-key "$@"
}
-# export the monkeysphere gpg pub key file
-update_gpg_pub_file() {
+# export the monkeysphere OpenPGP pub key file
+update_pgp_pub_file() {
log debug "updating openpgp public key file '$HOST_KEY_FILE'..."
gpg_host --export --armor --export-options export-minimal \
- $(gpg_host --list-secret-keys --with-colons --fingerprint | grep ^fpr | cut -f9 -d:) \
+ $(gpg_host --list-secret-keys --with-colons --fingerprint | grep ^fpr | cut -f10 -d:) \
> "$HOST_KEY_FILE"
}
-host_fingerprints() {
- local fprs=($(<"$HOST_KEY_FILE" "$SYSSHAREDIR/keytrans" listfprs))
-
- log debug "host key fingerprints:"
- printf '%s\n' "${fprs[@]}" | log debug
- printf '%s\n' "${fprs[@]}"
-}
-
# check that the service name is well formed
check_service_name() {
local name="$1"
check_key_input() {
local keyID="$1"
# array of fingerprints
- local fprs=($(host_fingerprints))
+ local fprs=($(list_primary_fingerprints <"$HOST_KEY_FILE"))
case ${#fprs[@]} in
0)
*)
if [ -z "$keyID" ] ; then
failure "Your host keyring contains multiple keys.
-Please specify one to act on (see 'monkeysphere-host show-key')."
+Please specify one to act on (see 'monkeysphere-host show-keys')."
fi
;;
esac
shift
local keys=$@
local i=0
- local fprs=($(host_fingerprints))
+ local fprs=($(list_primary_fingerprints <"$HOST_KEY_FILE"))
local key
check_no_keys
diagnostics
;;
- 'update-gpg-pub-file')
- update_gpg_pub_file
+ 'update-pgp-pub-file')
+ update_pgp_pub_file
;;
'version'|'v')