dbf52bb4b4
Check that the signing key exists when the user issues the :sign command. The signing key ID will be displayed in the security status also, allowing the user to see what key will be used to sign the message. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Jens Grassel <jens@wegtam.com>
13 lines
257 B
Go
13 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
|
|
}
|