diff options
author | Mattias Andrée <m@maandree.se> | 2025-02-09 10:59:22 +0100 |
---|---|---|
committer | Mattias Andrée <m@maandree.se> | 2025-02-09 10:59:22 +0100 |
commit | 03bc710cdb225694b34b3aefedd6098d28920680 (patch) | |
tree | cd27a622487dac5ccd2fa26b1ec44eb3a2404d4f | |
parent | Empty commit signed with new key and e-mail (diff) | |
download | openpgp-keys-03bc710cdb225694b34b3aefedd6098d28920680.tar.gz openpgp-keys-03bc710cdb225694b34b3aefedd6098d28920680.tar.bz2 openpgp-keys-03bc710cdb225694b34b3aefedd6098d28920680.tar.xz |
Signed-off-by: Mattias Andrée <m@maandree.se>
-rwxr-xr-x | new | 44 |
1 files changed, 44 insertions, 0 deletions
@@ -0,0 +1,44 @@ +#!/bin/sh + +set -e + +usage () { + printf 'usage: %s full-fingerprint\n' "$0" 2>&2 + exit 1 +} + +if test ! $# = 1; then + usage +fi + +id="$(printf '%s\n' "$1" | tr a-z A-Z | tr -d ' ')" +if test "${id::2}" = 0X; then + id="${id:2}" +fi + +if test -n "$(printf '%s\n' "${id}" | tr -d 0-9A-F)"; then + usage +fi + +if test "$(printf '%s' "${id}" | wc -c)" != 40; then + usage +fi + +if test -e "by-fingerprint/${id}"; then + printf '%s: key already added\n' "$0" 2>&2 + exit 1 +fi + +gpg --export --armour "${id}" > "by-fingerprint/${id}.pub.asc" + +i=1 +while test -e old-keys/maandree~$i.pub.asc; do + : $(( i++ )) +done +while (( i-- > 1 )); do + mv -- old-keys/maandree~$i.pub.asc old-keys/maandree~$(( i + 1 )).pub.asc +done + +ln -s -- "../$(readlink -- maandree.pub.asc)" old-keys/maandree~1.pub.asc +unlink -- maandree.pub.asc +ln -s -- "by-fingerprint/${id}.pub.asc" maandree.pub.asc |