keys.forget-keeper: Forget keeper nubs once recovery is done.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 16 Jul 2017 01:10:05 +0000 (02:10 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 16 Jul 2017 01:12:33 +0000 (02:12 +0100)
Makefile.am
keys.forget-keeper [new file with mode: 0755]
keys.new-keeper

index aa7982b..62032bf 100644 (file)
@@ -109,6 +109,7 @@ keyfunc.sh: keyfunc.sh.in Makefile
 ## Commands.
 dist_pkgdata_SCRIPTS   += keys.conceal
 dist_pkgdata_SCRIPTS   += keys.delete-keeper
+dist_pkgdata_SCRIPTS   += keys.forget-keeper
 dist_pkgdata_SCRIPTS   += keys.keeper-cards
 dist_pkgdata_SCRIPTS   += keys.keeper-nub
 dist_pkgdata_SCRIPTS   += keys.list-keepers
diff --git a/keys.forget-keeper b/keys.forget-keeper
new file mode 100755 (executable)
index 0000000..a6970c1
--- /dev/null
@@ -0,0 +1,53 @@
+#! /bin/sh
+###
+### Clear out stashed keeper nubs when they've all been saved
+###
+### (c) 2015 Mark Wooding
+###
+
+###----- Licensing notice ---------------------------------------------------
+###
+### This file is part of the distorted.org.uk key management suite.
+###
+### distorted-keys is free software; you can redistribute it and/or modify
+### it under the terms of the GNU General Public License as published by
+### the Free Software Foundation; either version 2 of the License, or
+### (at your option) any later version.
+###
+### distorted-keys is distributed in the hope that it will be useful,
+### but WITHOUT ANY WARRANTY; without even the implied warranty of
+### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+### GNU General Public License for more details.
+###
+### You should have received a copy of the GNU General Public License
+### along with distorted-keys; if not, write to the Free Software Foundation,
+### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+set -e
+case "${KEYSLIB+t}" in t) ;; *) echo >&2 "$0: KEYSLIB unset"; exit 1 ;; esac
+. "$KEYSLIB"/keyfunc.sh
+
+defhelp <<HELP
+KEEPER
+Forget keeper nubs once they've all been stashed safely.
+
+Forget the key nubs for the keeper set KEEPER, deleting them from the
+safe temporary place they were left by \`keys new-keeper.
+HELP
+
+## Parse the command line.
+case $# in 1) ;; *) usage_err ;; esac
+keeper=$1
+checkword "keeper label" "$keeper"
+
+## Check that the set is actually there.
+reqsafe
+if [ ! -d $SAFE/keys.keeper/$keeper ]; then
+  echo >&2 "$quis: no nubs available for keeper set \`$keeper'"
+  exit 1
+fi
+
+## Delete them.
+rm -rf $SAFE/keys.keeper/$keeper
+
+###----- That's all, folks --------------------------------------------------
index 78e792d..e14bb70 100755 (executable)
@@ -32,7 +32,8 @@ defhelp <<HELP
 Create a new set of keeper keys.
 
 The key nubs are stored in a safe but temporary place where they can be
-extracted using \`keys keeper-nub'.
+extracted using \`keys keeper-nub', and, eventually, forgotten using
+\`keys forget-keeper'.
 HELP
 
 ## Parse the command line.