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