verifier

package
v0.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package verifier contains the verifier interface and the cosign verifier implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CosignVerifier

type CosignVerifier struct {
	// contains filtered or unexported fields
}

CosignVerifier is a struct which is responsible for executing verification logic.

func NewCosignVerifier

func NewCosignVerifier(ctx context.Context, opts ...Options) (*CosignVerifier, error)

NewCosignVerifier initializes a new CosignVerifier.

func (*CosignVerifier) Verify

func (v *CosignVerifier) Verify(ctx context.Context, ref name.Reference) (bool, error)

Verify verifies the authenticity of the given ref OCI image. It returns a boolean indicating if the verification was successful. It returns an error if the verification fails, nil otherwise.

type Options

type Options func(opts *options)

Options is a function that configures the options applied to a Verifier.

func WithPublicKey

func WithPublicKey(publicKey []byte) Options

WithPublicKey sets the public key.

func WithRemoteOptions

func WithRemoteOptions(opts ...remote.Option) Options

WithRemoteOptions is a functional option for overriding the default remote options used by the verifier.

type Verifier

type Verifier interface {
	Verify(ctx context.Context, ref name.Reference) (bool, error)
}

Verifier is an interface for verifying the authenticity of an OCI image.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL