aerc/lib/crypto/gpg/gpgbin/keys.go

14 lines
257 B
Go

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
}