From b57fceaad4bfcbd4ca3022e013b73eff72079c0b Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Thu, 5 May 2022 12:53:16 -0500 Subject: pgp: add attach key command Add compose command ("attach-key") to attach the public key associated with the sending account. Public key is attached in ascii armor format, with the mimetype set according to RFC 3156 ("application/pgp-keys"). Signed-off-by: Tim Culverhouse Tested-by: Koni Marti --- lib/crypto/gpg/gpg.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/crypto/gpg/gpg.go') diff --git a/lib/crypto/gpg/gpg.go b/lib/crypto/gpg/gpg.go index fe32468c..00125ba6 100644 --- a/lib/crypto/gpg/gpg.go +++ b/lib/crypto/gpg/gpg.go @@ -59,6 +59,10 @@ func (m *Mail) GetKeyId(s string) (string, error) { return gpgbin.GetKeyId(s) } +func (m *Mail) ExportKey(k string) (io.Reader, error) { + return gpgbin.ExportPublicKey(k) +} + func handleSignatureError(e string) models.SignatureValidity { if e == "gpg: missing public key" { return models.UnknownEntity -- cgit