2021-10-05 22:42:42 -07:00
|
|
|
package cosign
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"github.com/google/go-containerregistry/pkg/name"
|
|
|
|
"github.com/sigstore/cosign/pkg/cosign"
|
|
|
|
)
|
|
|
|
|
|
|
|
var client Cosign = &driver{}
|
|
|
|
|
|
|
|
type Cosign interface {
|
2021-10-06 11:18:36 -07:00
|
|
|
Verify(ctx context.Context, signedImgRef name.Reference, co *cosign.CheckOpts) ([]cosign.SignedPayload, error)
|
2021-10-05 22:42:42 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
type driver struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *driver) Verify(ctx context.Context, signedImgRef name.Reference, co *cosign.CheckOpts) ([]cosign.SignedPayload, error) {
|
2021-10-06 09:55:23 -07:00
|
|
|
return cosign.Verify(ctx, signedImgRef, co)
|
2021-10-05 22:42:42 -07:00
|
|
|
}
|