From d09636ee0b9957ed60fc01224ddfbb03c4f4b7fa Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Mon, 25 Apr 2022 08:30:43 -0500 Subject: refactor: refactor pgp implementation This commit refactors the internal PGP implementation to make way for GPG integration. Signed-off-by: Tim Culverhouse Acked-by: Koni Marti Acked-by: Robin Jarry --- models/models.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'models') diff --git a/models/models.go b/models/models.go index 4087c9d3..96683f29 100644 --- a/models/models.go +++ b/models/models.go @@ -185,3 +185,27 @@ type OriginalMail struct { MIMEType string RFC822Headers *mail.Header } + +type SignatureValidity int32 + +const ( + UnknownValidity SignatureValidity = iota + Valid + InvalidSignature + UnknownEntity + UnsupportedMicalg + MicalgMismatch +) + +type MessageDetails struct { + IsEncrypted bool + IsSigned bool + SignedBy string // Primary identity of signing key + SignedByKeyId uint64 + SignatureValidity SignatureValidity + SignatureError string + DecryptedWith string // Primary Identity of decryption key + DecryptedWithKeyId uint64 // Public key id of decryption key + Body io.Reader + Micalg string +} -- cgit