commit 561e23766aadbc7fb01296e4a47d4f88da288c37 parent 753cf05e2faba378d7dff1d645aa8c29d9da878a Author: hhvn <dev@haydenvh.com> Date: Tue, 2 Mar 2021 12:59:52 +0000 .scripts/bin/hgpg[REMOVE]: learning GPG takes less time than making a good abstraction layer Diffstat:
D | .scripts/bin/hgpg | | | 57 | --------------------------------------------------------- |
1 file changed, 0 insertions(+), 57 deletions(-)
diff --git a/.scripts/bin/hgpg b/.scripts/bin/hgpg @@ -1,57 +0,0 @@ -#!/bin/sh - -export LC_ALL=c - -getpass="dpass gpg2key" - -usage(){ - cat << . -hgpg genkey - export-key <key1> ... - export-keyring - list [<key1> ...] - encrypt <recipient> [<file1> ...] - import [<file1> ...] - -<file> defaults to /dev/stdin -. -} - -[ -z $1 ] && usage -a="$1" -shift - -case "$a" in - genkey) gpg --gen-key ;; - export-key) - for k in $@ - do - gpg --fingerprint $k - printf "Destination? " - read -r dest </dev/tty - gpg --export --armour $k > $dest - done - ;; - export-keyring) gpg --export --armour ;; - list*) - [ ! -z $1 ] && args="--keyid-format $1" - gpg --list-keys $args && gpg --list-secret-keys $args - ;; - encrypt) - [ -z $1 ] && usage - r="$1" - shift - for f in /dev/stdin $@ - do - gpg --encrypt --sign --armour --passphrase "$($getpass)" -r "$r" - echo - done - ;; - import) - for k in /dev/stdin $@ - do - gpg --import $k - echo - done - ;; -esac