mirror of
https://github.com/containers/skopeo.git
synced 2025-06-29 16:17:44 +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) {
|
||||
key, err := m.ctx.GetKey(keyIdentity, true)
|
||||
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
|
||||
}
|
||||
inputData, err := gpgme.NewDataBytes(input)
|
||||
|
Loading…
Reference in New Issue
Block a user