signer

package
v5.24.2 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProgressMessage

func ProgressMessage(signer *Signer) string

ProgressMessage returns a human-readable sentence that makes sense to write before starting to create a single signature. Alternatively, should SignImageManifest be provided a logging writer of some kind?

func SignImageManifest

func SignImageManifest(ctx context.Context, signer *Signer, manifest []byte, dockerReference reference.Named) (signature.Signature, error)

SignImageManifest invokes a SignerImplementation. This is a function, not a method, so that it can only be called by code that is allowed to import this internal subpackage.

Types

type Signer

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

Signer is an object, possibly carrying state, that can be used by copy.Image to sign one or more container images. This type is visible to external callers, so it has no public fields or methods apart from Close().

The owner of a Signer must call Close() when done.

func NewSigner

func NewSigner(impl SignerImplementation) *Signer

NewSigner creates a public Signer from a SignerImplementation

func (*Signer) Close

func (s *Signer) Close() error

type SignerImplementation

type SignerImplementation interface {
	// ProgressMessage returns a human-readable sentence that makes sense to write before starting to create a single signature.
	ProgressMessage() string
	// SignImageManifest creates a new signature for manifest m as dockerReference.
	SignImageManifest(ctx context.Context, m []byte, dockerReference reference.Named) (signature.Signature, error)
	Close() error
}

SignerImplementation is an object, possibly carrying state, that can be used by copy.Image to sign one or more container images. This interface is distinct from Signer so that implementations can be created outside of this package.

Jump to

Keyboard shortcuts

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