diff options
author | Erich Eckner <git@eckner.net> | 2020-11-22 10:54:12 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2020-11-22 10:54:12 +0100 |
commit | 6cea1344cb3bdfa2352a7893817be257ce166104 (patch) | |
tree | 292118b6d8417e89dce6196461d5d1db5fc60119 /generate-header | |
download | autocrypt-master.tar.xz |
Diffstat (limited to 'generate-header')
-rwxr-xr-x | generate-header | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/generate-header b/generate-header new file mode 100755 index 0000000..2828c7a --- /dev/null +++ b/generate-header @@ -0,0 +1,19 @@ +#!/bin/bash + +# TODO: extract uid from 'From: ' header +uid='eeerich@eckner.net' +key=$( + gpg \ + --export \ + --export-options=export-minimal \ + --export-filter "keep-uid='uid =~ ${uid}'" \ + "${uid}" \ + | base64 -w72 +) + +if [ -n "${key}" ]; then + printf 'Autocrypt: addr=%s; prefer-encrypt=mutual; keydata=\n' \ + "${uid}" + printf '%s\n' "${key}" \ + | sed 's/^/ /' +fi |