From a86eda5d526265c56ab3014f938b0ab7e88601f8 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 13 Nov 2016 13:17:22 +0000 Subject: [PATCH] Option to show the users full gpg key --- src/freedombone-controlpanel-user | 47 ++++++++++++++++++------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/src/freedombone-controlpanel-user b/src/freedombone-controlpanel-user index 36d18ab9..baff23d5 100755 --- a/src/freedombone-controlpanel-user +++ b/src/freedombone-controlpanel-user @@ -403,6 +403,13 @@ function show_gpg_key { --msgbox $"Email Address: $MY_EMAIL_ADDRESS\n\nKey ID: $GPG_ID\n\nFingerprint: $GPG_FINGERPRINT\n\nCreated: $GPG_DATE" 12 70 } +function show_full_gpg_key { + clear + gpg --armor --export $GPG_ID + gpg --armor --export-secret-key $GPG_ID + any_key +} + function publish_gpg_key { gpg --send-key $GPG_ID if [ $GPG_BACKUP_ID ]; then @@ -663,17 +670,18 @@ 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:" 18 70 10 \ + --radiolist $"Choose an operation:" 19 70 11 \ 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 $"Sign a PGP/GPG key or website domain" off \ - 6 $"Refresh your PGP/GPG keys" off \ - 7 $"Add an ssh key for logging in" off \ - 8 $"Remove an ssh key for logging in" off \ - 9 $"Set the trust level for a PGP/GPG key" off \ - 10 $"Back to main menu" on 2> $data + 2 $"Show your full PGP/GPG key, including private key" off \ + 3 $"Publish your PGP/GPG key so that others can find it" off \ + 4 $"Add someone's PGP/GPG key" off \ + 5 $"Remove someone's PGP/GPG key" off \ + 6 $"Sign a PGP/GPG key or website domain" off \ + 7 $"Refresh your PGP/GPG keys" off \ + 8 $"Add an ssh key for logging in" off \ + 9 $"Remove an ssh key for logging in" off \ + 10 $"Set the trust level for a PGP/GPG key" off \ + 11 $"Back to main menu" on 2> $data sel=$? case $sel in 1) break;; @@ -681,15 +689,16 @@ function menu_encryption_keys { esac case $(cat $data) in 1) show_gpg_key;; - 2) publish_gpg_key;; - 3) add_gpg_key;; - 4) remove_gpg_key;; - 5) sign_gpg_key;; - 6) refresh_gpg_keys;; - 7) add_ssh_key;; - 8) remove_ssh_key;; - 9) gpg_key_trust;; - 10) break;; + 2) show_full_gpg_key;; + 3) publish_gpg_key;; + 4) add_gpg_key;; + 5) remove_gpg_key;; + 6) sign_gpg_key;; + 7) refresh_gpg_keys;; + 8) add_ssh_key;; + 9) remove_ssh_key;; + 10) gpg_key_trust;; + 11) break;; esac done }