Sign a key from the user control panel
This commit is contained in:
parent
83907dad8a
commit
24c1b859c9
|
@ -683,6 +683,33 @@ function syncthing_remove_id {
|
|||
--msgbox $"The ID was removed" 6 50
|
||||
}
|
||||
|
||||
function sign_gpg_key {
|
||||
data=$(tempfile 2>/dev/null)
|
||||
trap "rm -f $data" 0 1 2 5 15
|
||||
dialog --title $"Sign a PGP/GPG key" \
|
||||
--backtitle $"Freedombone User Control Panel" \
|
||||
--inputbox $"Enter the Key ID, address or domain to be signed" 8 75 2>$data
|
||||
sel=$?
|
||||
case $sel in
|
||||
0)
|
||||
SIGN_ADDRESS=$(<$data)
|
||||
if [ ${#IMAGE_URL} -gt 2 ]; then
|
||||
clear
|
||||
fpr=$(gpg --with-colons --fingerprint $SIGN_ADDRESS | grep fpr | head -n 1 | awk -F ':' '{print $10}')
|
||||
if [ ${#fpr} -gt 2 ]; then
|
||||
gpg --sign-key $fpr
|
||||
if [ "$?" = "0" ]; then
|
||||
gpg --update-trustdb
|
||||
dialog --title $"Sign a PGP/GPG key" \
|
||||
--backtitle $"Freedombone User Control Panel" \
|
||||
--msgbox $"$SIGN_ADDRESS was signed" 6 50
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function menu_encryption_keys {
|
||||
while true
|
||||
do
|
||||
|
@ -690,14 +717,15 @@ function menu_encryption_keys {
|
|||
trap "rm -f $data" 0 1 2 5 15
|
||||
dialog --backtitle $"Freedombone User Control Panel" \
|
||||
--title $"My Encryption Keys" \
|
||||
--radiolist $"Choose an operation:" 15 70 7 \
|
||||
--radiolist $"Choose an operation:" 16 70 8 \
|
||||
1 $"Show your PGP/GPG key" off \
|
||||
2 $"Publish your PGP/GPG key so that others can find it" off \
|
||||
3 $"Add someone's PGP/GPG key" off \
|
||||
4 $"Remove someone's PGP/GPG key" off \
|
||||
5 $"Add an ssh key for logging in" off \
|
||||
6 $"Remove an ssh key for logging in" off \
|
||||
7 $"Back to main menu" on 2> $data
|
||||
5 $"Sign a PGP/GPG key" off \
|
||||
6 $"Add an ssh key for logging in" off \
|
||||
7 $"Remove an ssh key for logging in" off \
|
||||
8 $"Back to main menu" on 2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
1) break;;
|
||||
|
@ -708,9 +736,10 @@ function menu_encryption_keys {
|
|||
2) publish_gpg_key;;
|
||||
3) add_gpg_key;;
|
||||
4) remove_gpg_key;;
|
||||
5) add_ssh_key;;
|
||||
6) remove_ssh_key;;
|
||||
7) break;;
|
||||
5) sign_gpg_key;;
|
||||
6) add_ssh_key;;
|
||||
7) remove_ssh_key;;
|
||||
8) break;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue