The complete list of supported algorithms.
[pgp-tools.git] / gpg-key2ps / gpg-key2ps
index c4efc6358a92d215ac67b740a830ef904a3af052..0d370e3204c6e03c43ed70663815a8e0750b67c1 100755 (executable)
@@ -1,8 +1,12 @@
 #! /bin/sh
+#
+# gpg-key2ps: convert a PGP/GnuPG key into paper slips.
+#
+# $Id$
 
 set -e
 
-VERSION="0.3.1"
+VERSION='$Rev$'
 USAGE="Usage: $0 [-p papersize] [-r revoked-style] keyid-or-name"
 
 
@@ -114,10 +118,15 @@ cat <<EOF
        /condhline { } def
 } def
 
+/showAlgorithm {
+  << 1 (R) 2 (r) 3 (s) 16 (g) 20 (G) 17 (D) >> exch get
+  show
+} def
+
 /pub {
        condhline
        50 y moveto (pub) show
-       70 y moveto show show (/) show show
+       70 y moveto show showAlgorithm (/) show show
        150 y moveto show
        200 y moveto show
        newline
@@ -170,7 +179,7 @@ cat <<EOF
 
 /sbk {
        50 y moveto (sub) show
-       70 y moveto show show (/) show show
+       70 y moveto show showAlgorithm (/) show show
        150 y moveto show
        newline
 } def
@@ -180,8 +189,7 @@ cat <<EOF
 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/^pub:[^:]*:\([^:]*\):\([0-9]*\):.\{8,8\}\(.\{8,8\}\):\([^:]*\):[^:]*:[^:]*:[^:]*:\([^:]*\):[^:]*:[^:]*:.*/   (\5) (\4) (\3) \2 (\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' \
@@ -189,7 +197,7 @@ sed -e '/^tru:/d' \
     -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:[^:]*:\([^:]*\):[^:]*:.\{8,8\}\(.\{8,8\}\):\([^:]*\):[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:.*/    (\3) (\2) (g) (\1) sbk/' \
+    -e 's/^sub:[^:]*:\([^:]*\):\([0-9]*\):.\{8,8\}\(.\{8,8\}\):\([^:]*\):[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:.*/       (\4) (\3) \2 (\1) sbk/' \
     <$TMPFILE
 cat <<EOF
 } def