[Pgp-tools-commit] r44 - in trunk: . gpg-key2ps gpg-mailkeys

Thijs Kinkhorst kink-guest at costa.debian.org
Thu Jun 2 23:13:36 UTC 2005


Author: kink-guest
Date: 2005-06-02 23:13:36 +0000 (Thu, 02 Jun 2005)
New Revision: 44

Added:
   trunk/gpg-key2ps/
   trunk/gpg-key2ps/README
   trunk/gpg-key2ps/gpg-key2ps
   trunk/gpg-key2ps/gpg-key2ps.1
   trunk/gpg-mailkeys/
   trunk/gpg-mailkeys/README
   trunk/gpg-mailkeys/example.gpg-mailkeysrc
   trunk/gpg-mailkeys/gpg-mailkeys
   trunk/gpg-mailkeys/gpg-mailkeys.1
Modified:
   trunk/README
Log:
Add gpg-key2ps and gpg-mailkeys from the signing-party package.
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.



Modified: trunk/README
===================================================================
--- trunk/README	2005-05-21 21:36:34 UTC (rev 43)
+++ trunk/README	2005-06-02 23:13:36 UTC (rev 44)
@@ -2,6 +2,8 @@
 
 * 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.

Added: trunk/gpg-key2ps/README
===================================================================
--- trunk/gpg-key2ps/README	2005-05-21 21:36:34 UTC (rev 43)
+++ trunk/gpg-key2ps/README	2005-06-02 23:13:36 UTC (rev 44)
@@ -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 at debian.org> and
+Thijs Kinkhorst <kink at 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
+
+

Added: trunk/gpg-key2ps/gpg-key2ps
===================================================================
--- trunk/gpg-key2ps/gpg-key2ps	2005-05-21 21:36:34 UTC (rev 43)
+++ trunk/gpg-key2ps/gpg-key2ps	2005-06-02 23:13:36 UTC (rev 44)
@@ -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


Property changes on: trunk/gpg-key2ps/gpg-key2ps
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/gpg-key2ps/gpg-key2ps.1
===================================================================
--- trunk/gpg-key2ps/gpg-key2ps.1	2005-05-21 21:36:34 UTC (rev 43)
+++ trunk/gpg-key2ps/gpg-key2ps.1	2005-06-02 23:13:36 UTC (rev 44)
@@ -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 at debian.org>.

Added: trunk/gpg-mailkeys/README
===================================================================
--- trunk/gpg-mailkeys/README	2005-05-21 21:36:34 UTC (rev 43)
+++ trunk/gpg-mailkeys/README	2005-06-02 23:13:36 UTC (rev 44)
@@ -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 at debian.org> and
+Thijs Kinkhorst <kink at 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
+
+

Added: trunk/gpg-mailkeys/example.gpg-mailkeysrc
===================================================================
--- trunk/gpg-mailkeys/example.gpg-mailkeysrc	2005-05-21 21:36:34 UTC (rev 43)
+++ trunk/gpg-mailkeys/example.gpg-mailkeysrc	2005-06-02 23:13:36 UTC (rev 44)
@@ -0,0 +1,17 @@
+# ~/.gpg-mailkeysrc
+
+# Sender name
+NAME="Your name here"
+
+# Sender address (don't use "<...>"!)
+EMAIL="your.address at 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!
+"

Added: trunk/gpg-mailkeys/gpg-mailkeys
===================================================================
--- trunk/gpg-mailkeys/gpg-mailkeys	2005-05-21 21:36:34 UTC (rev 43)
+++ trunk/gpg-mailkeys/gpg-mailkeys	2005-06-02 23:13:36 UTC (rev 44)
@@ -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


Property changes on: trunk/gpg-mailkeys/gpg-mailkeys
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/gpg-mailkeys/gpg-mailkeys.1
===================================================================
--- trunk/gpg-mailkeys/gpg-mailkeys.1	2005-05-21 21:36:34 UTC (rev 43)
+++ trunk/gpg-mailkeys/gpg-mailkeys.1	2005-06-02 23:13:36 UTC (rev 44)
@@ -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 at debian.org>.





More information about the Pgp-tools-commit mailing list