diff options
| author | EuAndreh <eu@euandre.org> | 2021-01-17 19:38:47 -0300 |
|---|---|---|
| committer | EuAndreh <eu@euandre.org> | 2021-01-17 19:43:31 -0300 |
| commit | 3b1de5a28d7298e7efa35ddedc432bcfd4582826 (patch) | |
| tree | f2a25a885527180d30bed14479f6dffa11589bc3 | |
| parent | README: org-mode to markdown (diff) | |
| download | dotfiles-3b1de5a28d7298e7efa35ddedc432bcfd4582826.tar.gz dotfiles-3b1de5a28d7298e7efa35ddedc432bcfd4582826.tar.xz | |
Embed export-keys.sh and copy-public-key.sh into README.md
I'd rather not automate these types of things.
| -rw-r--r-- | README.md | 68 | ||||
| -rwxr-xr-x | scripts/copy-public-key.sh | 23 | ||||
| -rwxr-xr-x | scripts/export-keys.sh | 35 |
3 files changed, 68 insertions, 58 deletions
@@ -96,3 +96,71 @@ To recover a paperkey: ``` {.shell} paperkey --pubring <(wget -O- https://euandre.org/public-key.txt | gpg --dearmor) --secrets paperkey-content.txt | gpg --batch --import ``` + +### `export-keys.sh` + +```shell +#!/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!" +``` + +### `copy-public-key.sh` + +``` +#!/bin/sh -eux + +FINGERPRINT='5BDAE9B8B2F6C6BCBB0D6CE581F90EC3CD356060' +FILE="$(mktemp)" + +gpg --batch --yes --output "${FILE}" --armor --export "${FINGERPRINT}" + +# Update keyserver +# gpg --send-keys "${FINGERPRINT}" + +# Add to website +cp "${FILE}" ~/dev/libre/website/public-key.txt + +# Update in euandreh-guix-channel +cd ~/dev/libre/euandreh-guix-channel/ +git checkout keyring +cp "${FILE}" euandreh.key +cd - + +# Update in github: can't be done + +# Clean up +rm "${FILE}" +``` diff --git a/scripts/copy-public-key.sh b/scripts/copy-public-key.sh deleted file mode 100755 index b864b4b1..00000000 --- a/scripts/copy-public-key.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -eux - -FINGERPRINT='5BDAE9B8B2F6C6BCBB0D6CE581F90EC3CD356060' -FILE="$(mktemp)" - -gpg --batch --yes --output "${FILE}" --armor --export "${FINGERPRINT}" - -# Update keyserver -# gpg --send-keys "${FINGERPRINT}" - -# Add to website -cp "${FILE}" ~/dev/libre/website/public-key.txt - -# Update in euandreh-guix-channel -cd ~/dev/libre/euandreh-guix-channel/ -git checkout keyring -cp "${FILE}" euandreh.key -cd - - -# Update in github: can't be done - -# Clean up -rm "${FILE}" diff --git a/scripts/export-keys.sh b/scripts/export-keys.sh deleted file mode 100755 index 5807dbce..00000000 --- a/scripts/export-keys.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/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!" |
