aboutsummaryrefslogtreecommitdiff
path: root/scripts/export-keys.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/export-keys.sh')
-rwxr-xr-xscripts/export-keys.sh26
1 files changed, 19 insertions, 7 deletions
diff --git a/scripts/export-keys.sh b/scripts/export-keys.sh
index b7ef50d..5807dbc 100755
--- a/scripts/export-keys.sh
+++ b/scripts/export-keys.sh
@@ -2,22 +2,34 @@
set -Eeuo pipefail
yellow "Exporting public key..."
-gpg --export --armor -a EuAndreh > keys
+gpg --export --armor -a EuAndreh > keys.gpg
green "Done."
yellow "Exporting private key..."
read -p "A prompt for the GPG password will appear! (Press any key to continue)" -n 1 -r
-gpg --export-secret-keys --armor -a EuAndreh >> keys
+gpg --export-secret-keys --armor -a EuAndreh >> keys.gpg
green "Done."
-yellow "Encrypting key pair..."
+yellow "Exporting ownertrust..."
+gpg --export-ownertrust > trust.txt
+green "Done."
+
+yellow "Creating tar with key pair and trust content..."
+tar -cvf EuAndreh.tar keys.gpg trust.txt
+green "Done."
+
+yellow "Encrypting tar file..."
read -p "A prompt for the symmetric encryption key of the keys.gpg file will appear! (Press any key to continue)" -n 1 -r
-gpg --cipher-algo AES256 -c keys
+gpg --cipher-algo AES256 -c EuAndreh.tar
green "Done."
yellow "Removing traces of private key..."
-shred keys
-rm keys
+shred trust.txt
+rm trust.txt
+shred keys.gpg
+rm keys.gpg
+shred EuAndreh.tar
+rm EuAndreh.tar
green "Done."
-blue "File 'keys.gpg' create!"
+blue "File 'EuAndreh.tar.gpg' created!"