diff options
Diffstat (limited to 'lib/crypto/gpg/gpgbin/keys.go')
-rw-r--r-- | lib/crypto/gpg/gpgbin/keys.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/crypto/gpg/gpgbin/keys.go b/lib/crypto/gpg/gpgbin/keys.go new file mode 100644 index 00000000..660ce821 --- /dev/null +++ b/lib/crypto/gpg/gpgbin/keys.go @@ -0,0 +1,13 @@ +package gpgbin + +import "fmt" + +// GetPrivateKeyId runs gpg --list-secret-keys s +func GetPrivateKeyId(s string) (string, error) { + private := true + id := getKeyId(s, private) + if id == "" { + return "", fmt.Errorf("no private key found") + } + return id, nil +} |