notation

package module
v0.0.0-...-cc0bd9b Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Verifier

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

Verifier is a ratify.Verifier implementation that verifies Notation signatures.

func NewVerifier

func NewVerifier(opts *VerifierOptions) (*Verifier, error)

NewVerifier creates a new Notation verifier.

func (*Verifier) Name

func (v *Verifier) Name() string

Name returns the name of the verifier.

func (*Verifier) Type

func (v *Verifier) Type() string

Type returns the type of the verifier which is always `notation`.

func (*Verifier) Verifiable

func (v *Verifier) Verifiable(artifact ocispec.Descriptor) bool

Verifiable returns true if the artifact is a Notation signature.

func (*Verifier) Verify

func (v *Verifier) Verify(ctx context.Context, opts *ratify.VerifyOptions) (*ratify.VerificationResult, error)

Verify verifies the Notation signature.

type VerifierOptions

type VerifierOptions struct {
	// Name is the instance name of the verifier to be created. Required.
	Name string

	// TrustPolicyDoc is a trustpolicy.json document. It should follow the spec:
	// https://github.com/notaryproject/notation-go/blob/v1.3.0/verifier/trustpolicy/oci.go#L29
	// Required.
	TrustPolicyDoc *trustpolicy.Document

	// TrustStore manages the certificates in the trust store. It should
	// implement the truststore.X509TrustStore interface:
	// https://github.com/notaryproject/notation-go/blob/v1.3.0/verifier/truststore/truststore.go#L52
	// Required.
	TrustStore truststore.X509TrustStore

	// PluginManager manages the plugins installed for Notation verifier. It
	// should implement the plugin.Manager interface:
	// https://github.com/notaryproject/notation-go/blob/v1.3.0/plugin/manager.go#L33
	// Optional.
	PluginManager plugin.Manager
}

VerifierOptions contains the options for creating a new Notation verifier.

Jump to

Keyboard shortcuts

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