Multiple key types, key profiles, and user key storage.
[distorted-keys] / keys.stash
old mode 100644 (file)
new mode 100755 (executable)
similarity index 88%
rename from stash
rename to keys.stash
index 98116b5..59eeabf
--- a/stash
@@ -35,24 +35,20 @@ The LABEL is used to identify the encrypted secret later to the \`recover'
 command.  The secret is read from SECRET, or stdin if SECRET is omitted or
 \`-'.
 HELP
-dohelp
 
 ## Parse the command line.
 case $# in
   2) if [ -t 0 ]; then echo >&2 "$quis: stdin is a terminal"; exit 1; fi ;;
   3) ;;
-  *) echo >&2 "$usage"; exit 1 ;;
+  *) usage_err ;;
 esac
 recov=$1 label=$2; shift 2
 checkword "recovery key label" "$recov"
 checklabel "secret" "$label"
 
 ## Do the thing.
-tmp=$(mktmp); cleanup rmtmp
+mktmp
 cat -- "$@" >$tmp/secret
-cd $KEYS/recov/$recov/current
-case $label in */*) mkdir -m755 -p ${label%/*} ;; esac
-ec_encrypt pub -i$tmp/secret -o$label.new
-mv $label.new $label.recov
+stash $recov $label <$tmp/secret
 
 ###----- That's all, folks --------------------------------------------------