diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-09-18 16:37:46 -0300 |
---|---|---|
committer | Silvio Rhatto <user@example.org> | 2014-09-18 16:37:46 -0300 |
commit | 7c4fe2e92918a3f05bd8dfcbafc0e3942cfca558 (patch) | |
tree | c3fb1f1938c102a75b356a25f4b32a12ee2ce88f | |
download | utils-gpg-7c4fe2e92918a3f05bd8dfcbafc0e3942cfca558.tar.gz utils-gpg-7c4fe2e92918a3f05bd8dfcbafc0e3942cfca558.tar.bz2 |
Initial import
-rw-r--r-- | README.md | 0 | ||||
-rw-r--r-- | TODO.md | 0 | ||||
-rwxr-xr-x | gpg-agent-eval | 21 | ||||
-rwxr-xr-x | lsign | 25 |
4 files changed, 46 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/README.md diff --git a/gpg-agent-eval b/gpg-agent-eval new file mode 100755 index 0000000..fab7334 --- /dev/null +++ b/gpg-agent-eval @@ -0,0 +1,21 @@ +#!/bin/bash +# +# Initialize the gpg-agent +# + +# GPG Agent +GPG_TTY=`tty` +export GPG_TTY + +function gpg_agent_eval_run { + if test -f $HOME/.gpg-agent-info && \ + kill -0 `cut -d: -f 2 $HOME/.gpg-agent-info` 2>/dev/null; then + GPG_AGENT_INFO=`cat $HOME/.gpg-agent-info` + export GPG_AGENT_INFO + else + eval `gpg-agent --daemon` + echo $GPG_AGENT_INFO >$HOME/.gpg-agent-info + fi +} + +gpg_agent_eval_run @@ -0,0 +1,25 @@ +#!/bin/bash +# +# Locally sign an OpenPGP key. +# + +# Parameters +BASENAME="`basename $0`" +NAME="$1" +set -e + +# Syntax check +if [ -z "$NAME" ]; then + echo "usage: $BASENAME <key>" + exit 1 +fi + +# Optional reason +read -e -p 'Optional lsignreason notation: ' REASON + +# Local signature +if [ ! -z "$REASON" ]; then + gpg --lsign --ask-cert-expire "$NAME" +else + gpg --lsign --cert-notation "lsigreason@notations.openpgp.fifthhorseman.net=${REASON}" --ask-cert-expire "$NAME" +fi |