diff options
Diffstat (limited to 'lib/crypto/gpg/gpgbin/keys.go')
-rw-r--r-- | lib/crypto/gpg/gpgbin/keys.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/crypto/gpg/gpgbin/keys.go b/lib/crypto/gpg/gpgbin/keys.go index 660ce821..9c8b233f 100644 --- a/lib/crypto/gpg/gpgbin/keys.go +++ b/lib/crypto/gpg/gpgbin/keys.go @@ -11,3 +11,13 @@ func GetPrivateKeyId(s string) (string, error) { } return id, nil } + +// GetKeyId runs gpg --list-keys s +func GetKeyId(s string) (string, error) { + private := false + id := getKeyId(s, private) + if id == "" { + return "", fmt.Errorf("no public key found") + } + return id, nil +} |