├── _config.yml ├── .gitattributes ├── .gitignore ├── example.pdf ├── example.png ├── fingerprint.tex └── README.md /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-slate -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.html linguist-documentation 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | fingerprint.pdf 2 | fingerprint-plain.txt 3 | -------------------------------------------------------------------------------- /example.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vog/fingerprint/HEAD/example.pdf -------------------------------------------------------------------------------- /example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vog/fingerprint/HEAD/example.png -------------------------------------------------------------------------------- /fingerprint.tex: -------------------------------------------------------------------------------- 1 | \documentclass[a4paper,12pt]{scrartcl} % 2>/dev/null || <<'\end{document}' 2 | 3 | % Key ID to print 4 | \newcommand{\keyid}{5F8990AF} 5 | 6 | % Number of repetitions 7 | \newcommand{\repetitions}{8} 8 | 9 | % Author: Volker Diels-Grabsch 10 | % This code is public domain. 11 | 12 | \usepackage[hmargin=1.5cm,vmargin=1cm]{geometry} 13 | \usepackage{xcolor,forloop} 14 | \usepackage{listings} 15 | \lstset{basicstyle=\footnotesize} 16 | \lstset{frame=shadowbox} 17 | \lstset{rulesepcolor=\color{gray}} 18 | \lstset{breaklines=true, breakatwhitespace=true} 19 | \begin{document} 20 | \immediate\write18{gpg2 --fingerprint \keyid >fingerprint-plain.txt} 21 | \lstinputlisting{fingerprint-plain.txt} 22 | \newcounter{ct} 23 | \forloop{ct}{1}{\value{ct}<\repetitions}{\vfill 24 | \lstinputlisting{fingerprint-plain.txt}} 25 | \end{document} 26 | 27 | # Configure shell to abort in case of an unexpected error 28 | set -e 29 | 30 | # Generate PDF 31 | pdflatex --shell-escape fingerprint.tex 32 | 33 | # Remove temporary files 34 | rm -f fingerprint.aux fingerprint.log fingerprint-plain.txt 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Instructions 2 | 3 | Print your GPG key fingerprint with LaTeX, and be better prepared for 4 | [ad hoc signings](http://keysigning.org/methods/adhoc) at the next 5 | [key signing party](https://en.wikipedia.org/wiki/Key_signing_party)! 6 | 7 | Install LaTeX with koma-script and forloop 8 | if haven't already done so. On Debian based systems, the installation 9 | command is: 10 | 11 | ``` 12 | apt-get install texlive-latex-extra 13 | ``` 14 | 15 | Download the LaTeX code which is public domain: 16 | 17 | * [fingerprint.tex](fingerprint.tex) 18 | 19 | Adjust the key ID so it will print your own key rather than mine. 20 | Also adjust the number of repetitions to fill the page: 21 | 22 | ``` 23 | % Key ID to print 24 | \newcommand{\keyid}{5F8990AF} 25 | 26 | % Number of repetitions 27 | \newcommand{\repetitions}{8} 28 | ``` 29 | 30 | Finally, generate the PDF file: 31 | 32 | ``` 33 | sh fingerprint.tex 34 | ``` 35 | 36 | The [result](#result) is shown below. Have fun! 37 | 38 | ## Related Projects 39 | 40 | * `gpg-key2ps` from the [signing-party](https://packages.debian.org/sid/signing-party) package 41 | 42 | ## Internals 43 | 44 | The short command `sh fingerprint.tex` works because the LaTeX code is 45 | written in a special way, so 46 | [it is also a working shell script](http://www.profv.de/literate-programming/) 47 | which executes `pdflatex` and removes all temporary files. 48 | Of course, you can also call `pdflatex` by hand. In that case, don't 49 | forget to provide the `--shell-escape` option, otherwise the LaTeX file 50 | isn't allowed to run `GPG` to retrieve your key fingerprint: 51 | 52 | ``` 53 | pdflatex --shell-escape fingerprint.tex 54 | ``` 55 | 56 | ## Result 57 | 58 | [![example.png](example.png)](example.pdf) 59 | 60 | (In case you want to know, the preview image was generated with 61 | [GraphicsMagick](http://www.graphicsmagick.org/): 62 | `gm convert -density 60 example.pdf example.png`) 63 | --------------------------------------------------------------------------------