mirror of
https://github.com/containers/skopeo.git
synced 2025-08-22 08:16:08 +00:00
Merge pull request #271 from runcom/fix-nokey-err
provide better error when key not found
This commit is contained in:
commit
28647cf29f
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