Add gpg-key2ps and gpg-mailkeys from the signing-party package.
authorkink-guest <kink-guest@b513b33f-fedd-0310-b452-c3deb5f4c849>
Thu, 2 Jun 2005 23:13:36 +0000 (23:13 +0000)
committerkink-guest <kink-guest@b513b33f-fedd-0310-b452-c3deb5f4c849>
Thu, 2 Jun 2005 23:13:36 +0000 (23:13 +0000)
I'm including gpg-mailkeys even though it has some overlapping
functionality with caff, because the first aim should be to
create a package that does at least the same as signing-party.

git-svn-id: svn://svn.debian.org/pgp-tools/trunk@44 b513b33f-fedd-0310-b452-c3deb5f4c849

README
gpg-key2ps/README [new file with mode: 0644]
gpg-key2ps/gpg-key2ps [new file with mode: 0755]
gpg-key2ps/gpg-key2ps.1 [new file with mode: 0644]
gpg-mailkeys/README [new file with mode: 0644]
gpg-mailkeys/example.gpg-mailkeysrc [new file with mode: 0644]
gpg-mailkeys/gpg-mailkeys [new file with mode: 0755]
gpg-mailkeys/gpg-mailkeys.1 [new file with mode: 0644]

diff --git a/README b/README
index 7bc04a1b018cb4122fa3683c6b8de5c725792b77..d85bd2b94f16e71718a6984169a282c415fe2f25 100644 (file)
--- a/README
+++ b/README
@@ -2,6 +2,8 @@ This repository is home for several projects relating to OpenPGP.
 
 * caff -- CA - fire and forget
 * gpgsigs -- annotate list of GnuPG keys with already done signatures
+* gpg-key2ps -- generate PostScript file with fingerprint paper strips
+* gpg-mailkeys -- simply mail out a signed key to its owner
 
 Please note that each individual project has its own license, please consult
 the licensing information in the subdirectories.
diff --git a/gpg-key2ps/README b/gpg-key2ps/README
new file mode 100644 (file)
index 0000000..94a2558
--- /dev/null
@@ -0,0 +1,44 @@
+gpg-key2ps
+----------
+
+Usage: gpg-key2ps [-p papersize] [-r revoked-style] keyid-or-name
+
+revoked-style is one of:
+  grey   - Print text in grey
+  hide   - Don't show revoked uids
+  note   - Add "(revoked)"
+  show   - List revoked uids normally
+  strike - Strike through lines
+
+Output is PostScript which can be sent to e.g. the lpr command.
+
+
+CREDITS
+-------
+
+This script comes from the original Signing-Party package which has been
+originally created and maintained by Simon Richter <sjr@debian.org> and
+Thijs Kinkhorst <kink@squirrelmail.org>.
+
+
+COPYRIGHT & LICENSE
+-------------------
+
+Copyright (C) 2001-2005  Simon Richter and Thijs Kinkhorst
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License with
+  the Debian GNU/Linux distribution in file /usr/share/common-licenses/GPL;
+  if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+  Suite 330, Boston, MA  02111-1307  USA
+
+
diff --git a/gpg-key2ps/gpg-key2ps b/gpg-key2ps/gpg-key2ps
new file mode 100755 (executable)
index 0000000..789d6d0
--- /dev/null
@@ -0,0 +1,228 @@
+#! /bin/sh
+
+set -e
+
+VERSION="0.3.1"
+USAGE="Usage: $0 [-p papersize] [-r revoked-style] keyid-or-name"
+
+
+if [ -z "$*" ]; then
+       echo $USAGE
+       exit 1
+fi
+
+KEYIDS=
+REVOKESTYLE=hide
+
+while [ -n "$1" ]; do
+       case "$1" in
+       -p)
+               PAPERSIZE=$2
+               export PAPERSIZE
+               shift 2
+               ;;
+       -p*)
+               PAPERSIZE=`echo $1 | sed -e 's/^-p//'`
+               export PAPERSIZE
+               shift 1
+               ;;
+       -r)
+               REVOKESTYLE=$2
+               shift 2
+               ;;
+       -r*)
+               REVOKESTYLE=`echo $1 | sed -e 's/^-r//'`
+               shift 1
+               ;;
+       -*)
+               echo $USAGE
+               exit 1
+               ;;
+       *)
+               KEYIDS=$1
+               shift 1
+               ;;
+       esac
+done
+
+case "$REVOKESTYLE" in
+grey|hide|note|show|strike)
+       ;;
+*)
+       echo >&2 "Unknown style \"$REVOKESTYLE\". Please use one of"
+       echo >&2 "  grey   - Print text in grey"
+       echo >&2 "  hide   - Don't show revoked uids"
+       echo >&2 "  note   - Add \"(revoked)\""
+       echo >&2 "  show   - List revoked uids normally"
+       echo >&2 "  strike - Strike through lines"
+       exit 1
+       ;;
+esac
+
+TMPFILE=`mktemp -t gpg-key2ps.XXXXXX`
+
+if ! gpg --fingerprint --with-colons $KEYIDS 2>/dev/null >$TMPFILE; then
+       echo >&2 "Key not found. Try 'gpg --list-keys'"
+       rm $TMPFILE
+       exit 1
+fi
+
+NUMLINES=$((`wc -l <$TMPFILE` + `grep '^pub:' $TMPFILE | wc -l` - 1))
+
+if test -x /usr/bin/paperconf; then
+       w=`paperconf -w`
+       h=`paperconf -h`
+else
+       # Default to A4.
+       w=596
+       h=842
+fi
+
+cat <<EOF
+%!PS-Adobe-3.0
+%%BoundingBox: 0 0 $w $h
+%%Title: 
+%%Creator: gpg-key2ps $VERSION
+EOF
+echo "%%CreationDate: `date`"
+cat <<EOF
+%%Pages: 1
+%%EndComments
+
+%%Page: 1 1
+
+/w $w def
+/h $h def
+
+/Times-Roman findfont 9 scalefont setfont 
+
+/newline {
+       /y y 10 sub def
+} def
+
+/hline {
+       30 y 3 add moveto
+       w 2 div 30 sub y 3 add lineto stroke
+       newline
+} def
+
+/needhline {
+       /condhline { hline } def
+} def
+
+/noneedhline {
+       /condhline { } def
+} def
+
+/pub {
+       condhline
+       50 y moveto (pub) show
+       70 y moveto show show (/) show show
+       150 y moveto show
+       200 y moveto show
+       newline
+       needhline
+} def
+
+/fpr {
+       70 y moveto (Key fingerprint = ) show show
+       newline
+} def
+
+/uid {
+       50 y moveto (uid) show
+       200 y moveto show
+       newline
+} def
+
+EOF
+
+case "$REVOKESTYLE" in
+grey)
+       echo "/revuid {"
+       echo "  .5 setgray"
+       echo "  uid"
+       echo "  0 setgray"
+       echo "} def"
+       ;;
+hide)
+       echo "/revuid {} def"
+       ;;
+note)
+       echo "/revuid {"
+       echo "  50 y moveto (uid) show"
+       echo "  200 y moveto show ([revoked]) show"
+       echo "  newline"
+       echo "} def"
+       ;;
+show)  
+       echo "/revuid { uid } def"
+       ;;
+strike)
+       echo "/revuid {"
+       echo "  uid"
+       echo "  45 y 9 add moveto h 2 div 45 sub y 18 add lineto stroke"
+       echo "} def"
+       ;;
+esac
+
+cat <<EOF
+
+/sbk {
+       50 y moveto (sub) show
+       70 y moveto show show (/) show show
+       150 y moveto show
+       newline
+} def
+
+/key {
+       noneedhline
+EOF
+sed -e '/^tru:/d' \
+    -e '/^uat:/d' \
+    -e 's/^pub:[^:]*:\([^:]*\):1:.\{8,8\}\(.\{8,8\}\):\([^:]*\):[^:]*:[^:]*:[^:]*:\([^:]*\):[^:]*:[^:]*:.*/    (\4) (\3) (\2) (R) (\1) pub/' \
+    -e 's/^pub:[^:]*:\([^:]*\):17:.\{8,8\}\(.\{8,8\}\):\([^:]*\):[^:]*:[^:]*:[^:]*:\([^:]*\):[^:]*:[^:]*:.*/   (\4) (\3) (\2) (D) (\1) pub/' \
+    -e 's/^fpr:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\):.*/   (\1) fpr/' \
+    -e 's/(\(.\{16,16\}\)\(.\{16,16\}\)) fpr/(@split@\1@  @split@\2@) fpr/' \
+    -e 's/@split@\(.\{2,2\}\)\(.\{2,2\}\)\(.\{2,2\}\)\(.\{2,2\}\)\(.\{2,2\}\)\(.\{2,2\}\)\(.\{2,2\}\)\(.\{2,2\}\)@/\1 \2 \3 \4 \5 \6 \7 \8/g' \
+    -e 's/(\(.\{20,20\}\)\(.\{20,20\}\)) fpr/(@split@\1@  @split@\2@) fpr/' \
+    -e 's/@split@\(.\{4,4\}\)\(.\{4,4\}\)\(.\{4,4\}\)\(.\{4,4\}\)\(.\{4,4\}\)@/\1 \2 \3 \4 \5/g' \
+    -e 's/^uid:[^:r]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\):.*/  (\1) uid/' \
+    -e 's/^uid:r[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\):.*/  (\1) revuid/' \
+    -e 's/^sub:[^:]*:\([^:]*\):16:.\{8,8\}\(.\{8,8\}\):\([^:]*\):[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:.*/       (\3) (\2) (g) (\1) sbk/' \
+    <$TMPFILE
+cat <<EOF
+} def
+
+EOF
+echo "/numlines $(($NUMLINES + 1)) def"
+cat <<EOF
+/num w 16 sub 10 div numlines div def
+
+/column {
+       /y w 20 sub def
+       1 1 num {
+               gsave
+               0 0 h 2 div w rectclip
+               /upper y 11 add def
+               key
+               newline
+               /lower y 11 add def
+               0 upper h 2 div upper h 2 div lower 0 lower 0 upper moveto lineto lineto lineto lineto stroke
+               grestore
+       } for
+} def
+
+w 0 translate
+90 rotate
+column
+h 2 div 0 translate
+column
+
+showpage
+
+%%Trailer
+%%EOF
+EOF
+
+rm $TMPFILE
diff --git a/gpg-key2ps/gpg-key2ps.1 b/gpg-key2ps/gpg-key2ps.1
new file mode 100644 (file)
index 0000000..dbe9d0a
--- /dev/null
@@ -0,0 +1,40 @@
+.TH GPG-KEY2PS 1 "February 11, 2001"
+.SH NAME
+gpg\-key2ps \- generates a PS file from a GnuPG keyring
+.SH SYNOPSIS
+.B gpg-key2ps
+.I [-p paper]
+.I [-r revoked-style]
+.RI id
+.SH DESCRIPTION
+.B gpg-key2ps
+generates a PostScript file with your OpenPGP key fingerprint (repeated as
+often as it fits) useful for keysigning parties. The only argument is the same
+as you would pass to GPG's list-keys command, either a key-id or a (partial)
+name. The PS data is written to stdout.
+.SH OPTIONS
+.TP 13
+.I \-p paper
+Select the output paper size. Default is to look into /etc/papersize or A4 if
+libpaper isn't installed
+.TP
+.I \-r revoked-style
+Select how to mark revoked UIDs. Five styles are available:
+.B hide
+(don't show at all),
+.B show
+(show normally),
+.B grey
+(display in 50% grey),
+.B note
+(add a note),
+.B strike
+(strike through).
+.SH BUGS
+.B gpg-key2ps
+does not check whether it would be better to print just one column, and wastes
+space with "-r hide".
+.SH SEE ALSO
+.BR gpg (1)
+.SH AUTHOR
+This manual page was written by Simon Richter <sjr@debian.org>.
diff --git a/gpg-mailkeys/README b/gpg-mailkeys/README
new file mode 100644 (file)
index 0000000..ea49378
--- /dev/null
@@ -0,0 +1,41 @@
+gpg-mailkeys
+------------
+
+Given one or more key-id's, gpg-mailkeys mails these keys to their owners. You
+use this after you've signed them. By default, the mails contain a standard
+text and your name and address as the From (as determined by the sendmail
+command).
+
+You can modify how this script behaves by putting a .gpg-mailkeysrc file in
+your homedir. An example of this file is provided with this document.
+
+
+CREDITS
+-------
+
+This script comes from the original Signing-Party package which has been
+originally created and maintained by Simon Richter <sjr@debian.org> and
+Thijs Kinkhorst <kink@squirrelmail.org>.
+
+
+COPYRIGHT & LICENSE
+-------------------
+
+Copyright (C) 2001-2005  Simon Richter and Thijs Kinkhorst
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License with
+  the Debian GNU/Linux distribution in file /usr/share/common-licenses/GPL;
+  if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+  Suite 330, Boston, MA  02111-1307  USA
+
+
diff --git a/gpg-mailkeys/example.gpg-mailkeysrc b/gpg-mailkeys/example.gpg-mailkeysrc
new file mode 100644 (file)
index 0000000..6a75b96
--- /dev/null
@@ -0,0 +1,17 @@
+# ~/.gpg-mailkeysrc
+
+# Sender name
+NAME="Your name here"
+
+# Sender address (don't use "<...>"!)
+EMAIL="your.address@example.org"
+
+# Subject
+SUBJECT="Your signed key"
+
+# Text to be included in the message body
+TEXT="
+Hi, here you are: your signed key.
+
+See you!
+"
diff --git a/gpg-mailkeys/gpg-mailkeys b/gpg-mailkeys/gpg-mailkeys
new file mode 100755 (executable)
index 0000000..c065751
--- /dev/null
@@ -0,0 +1,99 @@
+#! /bin/sh
+
+set -e
+
+VERSION="0.3.1"
+
+if [ -z "$*" ]; then
+       echo "Send people their newly signed GPG key by mail."
+       echo "Usage: $0 keyid ..."
+       exit 1
+fi
+
+if [ -e ~/.gpg-mailkeysrc ] ; then
+       . ~/.gpg-mailkeysrc
+fi
+if [ -n "$EMAIL" ]; then
+       FROM="$EMAIL"
+fi
+if [ -z "$SUBJECT" ]; then
+       SUBJECT="Your signed GPG key"
+fi
+if [ -z "$NAME" ]; then
+       NAME=`getent passwd $USER | cut -d: -f5 | cut -d, -f1`
+fi
+if [ -z "$TEXT" ]; then
+       TEXT="Hi,
+
+Here is your signed GPG key.
+
+Enjoy,
+$NAME"
+fi
+
+FAILKEYS=
+
+while [ -n "$1" ]; do
+       echo -n "[$1] "
+       TEMPFILE=`mktemp -t gpg2mail.XXXXXX`
+       ADDR=`gpg --with-colons --fixed-list-mode --list-key $1 | sed -e 's/^uid:[^re][^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:<]*<[^:>]*>\):.*/@@uid@@ \1/' -e '/^@@uid@@ /!d' -e 's/([^)]*)//g' -e 's/  */ /g' -e 's/^@@uid@@ //' | head -1`
+       if [ -z "$ADDR" ]; then
+               echo "(no usable user ids)"
+               FAILKEYS="$FAILKEYS:$1"
+               shift 1
+               continue
+       fi
+       BOUNDARY="ksp-$$-boundary-$RANDOM"
+       
+       echo -n "$ADDR:"
+       if [ $FROM ]; then
+               echo >$TEMPFILE "From: $NAME <$FROM>"
+       fi
+cat << EOM >> $TEMPFILE
+To: $ADDR
+Subject: $SUBJECT
+User-Agent: gpg-mailkeys/$VERSION
+MIME-Version: 1.0
+Content-Type: multipart/mixed; micalg=pgp-sha1;
+    protocol="application/pgp-signature"; boundary="$BOUNDARY"
+Content-Disposition: inline
+
+
+
+--$BOUNDARY
+Content-Type: text/plain; charset=us-ascii
+Content-Disposition: inline
+Content-Transfer-Encoding: quoted-printable
+
+$TEXT
+
+EOM
+
+if [ -f ~/.signature ]; 
+       then echo "--=20" >> $TEMPFILE 
+       cat ~/.signature >> $TEMPFILE
+fi
+
+cat << EOM >> $TEMPFILE
+
+--$BOUNDARY
+Content-Type: text/plain; charset=us-ascii
+Content-Disposition: attachment; filename="$1.sig"
+
+`gpg --armor --export $1`
+
+--$BOUNDARY--
+EOM
+       echo -n " sending"
+       /usr/sbin/sendmail -t <$TEMPFILE
+       rm $TEMPFILE
+       echo " done."
+       shift 1
+done
+
+if [ -n "$FAILKEYS" ]; then
+       echo
+       echo "Note: The following keys could not be sent:"
+       echo "$FAILKEYS" | tr ':' '\n' | sed -e '/^ *$/d' -e 's/^/  /'
+fi
diff --git a/gpg-mailkeys/gpg-mailkeys.1 b/gpg-mailkeys/gpg-mailkeys.1
new file mode 100644 (file)
index 0000000..c8e5009
--- /dev/null
@@ -0,0 +1,21 @@
+.TH GPG-MAILKEYS 1 "February 15, 2003"
+.SH NAME
+gpg\-mailkeys \- sends emails containing keys to their owners
+.SH SYNOPSIS
+.B gpg-mailkeys
+.RI id ...
+.SH DESCRIPTION
+.B gpg-mailkeys
+sends the owners of the keys listed on the command line a mail each,
+containing their public key. After signing, you can use this tool to send
+everyone the new signatures they just got.
+.SH OPTIONS
+None
+.SH ENVIRONMENT
+.TP 13
+.I EMAIL
+Set the email address to use when sending messages
+.SH SEE ALSO
+.BR gpg (1)
+.SH AUTHOR
+This manual page was written by Simon Richter <sjr@debian.org>.