2021-10-06 05:42:42 +00:00
|
|
|
package cosign
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2021-10-29 10:24:26 +00:00
|
|
|
|
2021-10-06 05:42:42 +00:00
|
|
|
"github.com/google/go-containerregistry/pkg/name"
|
|
|
|
"github.com/sigstore/cosign/pkg/cosign"
|
2021-11-03 07:45:35 +00:00
|
|
|
"github.com/sigstore/cosign/pkg/oci"
|
2021-10-06 05:42:42 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var client Cosign = &driver{}
|
|
|
|
|
|
|
|
type Cosign interface {
|
2022-01-28 05:13:23 +00:00
|
|
|
VerifyImageSignatures(ctx context.Context, signedImgRef name.Reference, co *cosign.CheckOpts) ([]oci.Signature, bool, error)
|
|
|
|
|
|
|
|
VerifyImageAttestations(ctx context.Context, signedImgRef name.Reference, co *cosign.CheckOpts) (checkedAttestations []oci.Signature, bundleVerified bool, err error)
|
2021-10-06 05:42:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type driver struct {
|
|
|
|
}
|
|
|
|
|
2022-01-28 05:13:23 +00:00
|
|
|
func (d *driver) VerifyImageSignatures(ctx context.Context, signedImgRef name.Reference, co *cosign.CheckOpts) ([]oci.Signature, bool, error) {
|
|
|
|
return cosign.VerifyImageSignatures(ctx, signedImgRef, co)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *driver) VerifyImageAttestations(ctx context.Context, signedImgRef name.Reference, co *cosign.CheckOpts) (checkedAttestations []oci.Signature, bundleVerified bool, err error) {
|
|
|
|
return cosign.VerifyImageAttestations(ctx, signedImgRef, co)
|
2021-10-06 05:42:42 +00:00
|
|
|
}
|