checkword () { check "$1" "$R_WORD" "$2"; }
checklabel () { check "$1 label" "$R_LABEL" "$2"; }
+## Boolean canonification.
+boolify () {
+ var=$1 what=$2
+
+ eval v=\$$var
+ case $v in
+ 1 | y | yes | on | t | true) v=t ;;
+ 0 | n | no | off | f | false | nil) v=nil ;;
+ *) echo >&2 "$quis: bad boolean $what \`$v'"; exit 1 ;;
+ esac
+ eval $var=\$v
+}
+
###--------------------------------------------------------------------------
### Key storage and properties.
## options to the key type.
## Set options and check them.
+ kopt_owner=$kowner kopt_label=$klabel
setprops "option" kopt_ "$@"
checkprops "option" kopt_ "$k_genopts"
## Create directory structure and start writing metadata.
rm -rf "$kdir.new"
mkdir -m755 -p "$kdir.new"
- case "$knub" in */*) mkdir -m700 -p "${knub%/*}" ;; esac
+ case "$knub" in */*) mkdir -m755 -p "${knub%/*}" ;; esac
cat >"$kdir.new/meta" <<EOF
$profile
EOF
## Generate the key.
- umask=$(umask); umask 077; >"$knub.new"; umask $umask
+ (umask 077; makenub >"$knub.new")
k_generate "$kdir.new" "$knub.new"
$hook "$kdir.new" "$knub.new"