Add signkey create
- Add a CLI command for creating a new signing key.
This commit is contained in:
@@ -30,9 +30,7 @@ if [ -f /var/mail/juliette ] ; then
|
||||
|
||||
if [ "$SIGN_FPR" != "$FOUND_FPR" ] ; then
|
||||
echo "Found wrong fingerprint '$FOUND_FPR' - expected '$SIGN_FPR'"
|
||||
RESULT_CODE=1
|
||||
else
|
||||
RESULT_CODE=0
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "no encryption detected"
|
||||
@@ -43,3 +41,31 @@ else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "set new signing key"
|
||||
|
||||
SIGN_FPR=$($HUSK_BIN --config config/config.toml signkey create | cut -d ':' -f 2 | tr -d ' ')
|
||||
echo "new signing key $SIGN_FPR"
|
||||
|
||||
# remove old mail
|
||||
rm /var/mail/juliette
|
||||
|
||||
echo "send mail to juliette@example.com"
|
||||
send_test_mail juliette@example.com
|
||||
|
||||
if [ -f /var/mail/juliette ] ; then
|
||||
if grep -q "BEGIN PGP MESSAGE" /var/mail/juliette ; then
|
||||
|
||||
FOUND_FPR=$(sq packet dump /var/mail/juliette | grep "Issuer Fingerprint:" | cut -d ':' -f 2 | tr -d ' ')
|
||||
|
||||
if [ "$SIGN_FPR" != "$FOUND_FPR" ] ; then
|
||||
echo "Found wrong fingerprint '$FOUND_FPR' - expected '$SIGN_FPR'"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "no encryption detected"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "no mail detected"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user