2006-08-21 20:20:23 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2009-04-19 16:34:21 +00:00
|
|
|
# We need to use --no-options so that a gpg.conf from an older version
|
|
|
|
# of gpg is not used.
|
2010-10-14 16:34:31 +00:00
|
|
|
GPG="../../g10/gpg2 --no-options --batch --quiet
|
2009-04-19 16:34:21 +00:00
|
|
|
--no-secmem-warning --allow-secret-key-import"
|
|
|
|
|
2006-08-21 20:20:23 +00:00
|
|
|
NAMES='Alpha Bravo Charlie Delta Echo Foxtrot Golf Hotel India
|
|
|
|
Juliet Kilo Lima Mike November Oscar Papa Quebec Romeo
|
|
|
|
Sierra Tango Uniform Victor Whisky XRay Yankee Zulu'
|
|
|
|
|
|
|
|
if [ "$1" = "--clean" ]; then
|
|
|
|
(for i in $NAMES; do
|
|
|
|
[ -d $i ] && rm -r $i
|
|
|
|
done) || true
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
$GPG --dearmor -o secdemo.gpg --yes ../checks/secdemo.asc
|
|
|
|
$GPG --dearmor -o pubdemo.gpg --yes ../checks/pubdemo.asc
|
|
|
|
[ -f ./tdb.tmp ] && rm ./tdb.tmp
|
|
|
|
GPGDEMO="$GPG --homedir . --trustdb-name ./tdb.tmp --no-default-keyring
|
|
|
|
--keyring pubdemo.gpg --secret-keyring secdemo.gpg"
|
|
|
|
echo -n "Creating:"
|
|
|
|
for name in $NAMES; do
|
|
|
|
echo -n " $name"
|
|
|
|
[ -d $name ] && rm -r $name
|
|
|
|
mkdir $name
|
|
|
|
$GPGDEMO --export-secret-key -o - $name > $name/Secret.gpg
|
|
|
|
$GPG --homedir $name --import $name/Secret.gpg
|
|
|
|
$GPGDEMO --export -o - $name > $name/Public.gpg
|
|
|
|
$GPG --homedir $name --import $name/Public.gpg
|
|
|
|
[ -f $name/pubring.gpg~ ] && rm $name/pubring.gpg~
|
|
|
|
done
|
|
|
|
echo "."
|
|
|
|
[ -f ./tdb.tmp ] && rm ./tdb.tmp
|
|
|
|
rm pubdemo.gpg secdemo.gpg
|
|
|
|
|
|
|
|
|