mirror of
https://github.com/slsa-framework/slsa-verifier.git
synced 2026-05-13 20:16:41 +00:00
* update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update
19 lines
469 B
Go
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)
|
|
}
|