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"
|
|
|
|
)
|
|
|
|
|
|
|
|
var client Cosign = &driver{}
|
|
|
|
|
|
|
|
type Cosign interface {
|
2021-10-06 18:18:36 +00:00
|
|
|
Verify(ctx context.Context, signedImgRef name.Reference, co *cosign.CheckOpts) ([]cosign.SignedPayload, error)
|
2021-10-06 05:42:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type driver struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *driver) Verify(ctx context.Context, signedImgRef name.Reference, co *cosign.CheckOpts) ([]cosign.SignedPayload, error) {
|
2021-10-06 16:55:23 +00:00
|
|
|
return cosign.Verify(ctx, signedImgRef, co)
|
2021-10-06 05:42:42 +00:00
|
|
|
}
|