diff --git a/cmd/cosign/cli/verify/verify_blob.go b/cmd/cosign/cli/verify/verify_blob.go index 0af118786f98..4cd9affc0276 100644 --- a/cmd/cosign/cli/verify/verify_blob.go +++ b/cmd/cosign/cli/verify/verify_blob.go @@ -170,7 +170,9 @@ func (c *VerifyBlobCmd) Exec(ctx context.Context, blobRef string) error { if err != nil { return err } - if b.Cert == "" { + // A certificate is required in the bundle unless we specified with + // --key, --sk, or --certificate. + if b.Cert == "" && co.SigVerifier == nil && cert == nil { return fmt.Errorf("bundle does not contain cert for verification, please provide public key") } // b.Cert can either be a certificate or public key