mirror of
https://github.com/containers/skopeo.git
synced 2025-06-30 16:42:24 +00:00
provide better error when key not found
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
a515fefda9
commit
0c8511f222
3
vendor/github.com/containers/image/signature/mechanism.go
generated
vendored
3
vendor/github.com/containers/image/signature/mechanism.go
generated
vendored
@ -76,6 +76,9 @@ func (m gpgSigningMechanism) ImportKeysFromBytes(blob []byte) ([]string, error)
|
|||||||
func (m gpgSigningMechanism) Sign(input []byte, keyIdentity string) ([]byte, error) {
|
func (m gpgSigningMechanism) Sign(input []byte, keyIdentity string) ([]byte, error) {
|
||||||
key, err := m.ctx.GetKey(keyIdentity, true)
|
key, err := m.ctx.GetKey(keyIdentity, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if e, ok := err.(gpgme.Error); ok && e.Code() == gpgme.ErrorEOF {
|
||||||
|
return nil, fmt.Errorf("key %q not found", keyIdentity)
|
||||||
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
inputData, err := gpgme.NewDataBytes(input)
|
inputData, err := gpgme.NewDataBytes(input)
|
||||||
|
Loading…
Reference in New Issue
Block a user