Files
slsa-verifier/verifiers/utils/container/cosign.go
laurentsimon b58e752378 feat: support builderID matching with or without semver for GCB (#256)
* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update
2022-09-12 17:17:46 -07:00

19 lines
469 B
Go

package container
import (
"context"
crname "github.com/google/go-containerregistry/pkg/name"
"github.com/sigstore/cosign/pkg/cosign"
"github.com/sigstore/cosign/pkg/oci"
)
var RunCosignImageVerification = func(ctx context.Context,
image string, co *cosign.CheckOpts) ([]oci.Signature, bool, error) {
signedImgRef, err := crname.ParseReference(image)
if err != nil {
return nil, false, err
}
return cosign.VerifyImageAttestations(ctx, signedImgRef, co)
}