aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto/pgp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/crypto/pgp')
-rw-r--r--lib/crypto/pgp/pgp.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/crypto/pgp/pgp.go b/lib/crypto/pgp/pgp.go
index e0c5671b..f0f3f655 100644
--- a/lib/crypto/pgp/pgp.go
+++ b/lib/crypto/pgp/pgp.go
@@ -263,6 +263,14 @@ func (m *Mail) GetSignerKeyId(s string) (string, error) {
return signerEntity.PrimaryKey.KeyIdString(), nil
}
+func (m *Mail) GetKeyId(s string) (string, error) {
+ entity, err := m.getEntityByEmail(s)
+ if err != nil {
+ return "", err
+ }
+ return entity.PrimaryKey.KeyIdString(), nil
+}
+
func handleSignatureError(e string) models.SignatureValidity {
if e == "openpgp: signature made by unknown entity" {
return models.UnknownEntity