]> gitweb.fluxo.info Git - utils-gpg.git/commitdiff
Initial import
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 18 Sep 2014 19:37:46 +0000 (16:37 -0300)
committerSilvio Rhatto <user@example.org>
Thu, 18 Sep 2014 19:37:46 +0000 (16:37 -0300)
README.md [new file with mode: 0644]
TODO.md [new file with mode: 0644]
gpg-agent-eval [new file with mode: 0755]
lsign [new file with mode: 0755]

diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/TODO.md b/TODO.md
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/gpg-agent-eval b/gpg-agent-eval
new file mode 100755 (executable)
index 0000000..fab7334
--- /dev/null
@@ -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
diff --git a/lsign b/lsign
new file mode 100755 (executable)
index 0000000..e1ceb3d
--- /dev/null
+++ b/lsign
@@ -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