blob: 5807dbce4a9d34c67b6b4ea7402a8335e3d5a5fb (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#!/usr/bin/env bash
set -Eeuo pipefail
yellow "Exporting public key..."
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
green "Done."
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 EuAndreh.tar
green "Done."
yellow "Removing traces of private key..."
shred trust.txt
rm trust.txt
shred keys.gpg
rm keys.gpg
shred EuAndreh.tar
rm EuAndreh.tar
green "Done."
blue "File 'EuAndreh.tar.gpg' created!"
|