notation

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CA               certStoreType = "ca"
	SigningAuthority certStoreType = "signingAuthority"
	TSA              certStoreType = "tsa"
)

Variables

This section is empty.

Functions

func CacheCRL added in v1.4.0

func CacheCRL(ctx context.Context, certs []*x509.Certificate, fetcher corecrl.Fetcher)

cacheCRL caches the Certificate Revocation Lists (CRLs) for the given certificates using the provided CRL fetcher. It logs a warning if fetching the CRL fails but does not return an error to ensure the process is not blocked.

func CreateCRLFetcher added in v1.4.0

func CreateCRLFetcher(httpClient *http.Client, cacheRoot string) (corecrl.Fetcher, error)

CreateCRLFetcher returns a new fetcher instance

func SupportCRL added in v1.4.0

func SupportCRL(cert *x509.Certificate) bool

SupportCRL checks if the certificate supports CRL

Types

type CRLHandler added in v1.4.0

type CRLHandler struct {
	CacheEnabled bool
	// contains filtered or unexported fields
}

func (*CRLHandler) NewFetcher added in v1.4.0

func (h *CRLHandler) NewFetcher() (corecrl.Fetcher, error)

NewFetcher creates a new instance of a Fetcher if it doesn't already exist. If a Fetcher instance is already present, it returns the existing instance. The method also configures the cache for the Fetcher. Returns an instance of corecrl.Fetcher or an error if the Fetcher creation fails.

func (*CRLHandler) NewValidator added in v1.4.0

func (h *CRLHandler) NewValidator(opts revocation.Options) (revocation.Validator, error)

NewValidator returns a new validator instance

type NotationPluginVerifierConfig

type NotationPluginVerifierConfig struct {
	Name          string `json:"name"`
	ArtifactTypes string `json:"artifactTypes"`

	// VerificationCerts is array of directories containing certificates.
	VerificationCerts []string `json:"verificationCerts"`
	// VerificationCertStores defines a collection of Notary Project Trust Stores.
	// VerificationCertStores accepts new format map[string]map[string][]string
	// {
	//   "ca": {
	//     "certs": {"kv1", "kv2"},
	//   },
	//   "signingauthority": {
	//     "certs": {"kv3"}
	//   },
	// }
	// VerificationCertStores accepts legacy format map[string][]string as well.
	// {
	//   "certs": {"kv1", "kv2"},
	// },
	VerificationCertStores verificationCertStores `json:"verificationCertStores"`
	// TrustPolicyDoc represents a trustpolicy.json document. Reference: https://pkg.go.dev/github.com/notaryproject/notation-go@v0.12.0-beta.1.0.20221125022016-ab113ebd2a6c/verifier/trustpolicy#Document
	TrustPolicyDoc trustpolicy.Document `json:"trustPolicyDoc"`
}

NotationPluginVerifierConfig describes the configuration of notation verifier

type RatifyPluginManager

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

Implements interface defined in https://github.com/notaryproject/notation-go/blob/main/plugin/manager.go#L20

func NewRatifyPluginManager

func NewRatifyPluginManager(directory string) *RatifyPluginManager

func (*RatifyPluginManager) Get

func (m *RatifyPluginManager) Get(ctx context.Context, name string) (pl.Plugin, error)

Returns a notation Plugin for the given name if present in the target directory

func (*RatifyPluginManager) List

Lists available notation plugins in the target directory

type RevocationFactory added in v1.4.0

type RevocationFactory interface {
	// NewFetcher returns a new fetcher instance
	NewFetcher() (corecrl.Fetcher, error)

	// NewValidator returns a new validator instance
	NewValidator(revocation.Options) (revocation.Validator, error)
}

RevocationFactory is an interface that defines methods for creating instances related to revocation. It provides methods to create a new fetcher and a new validator.

func CreateCRLHandlerFromConfig added in v1.4.0

func CreateCRLHandlerFromConfig() RevocationFactory

CreateCRLHandlerFromConfig creates a new instance of CRLHandler using the configuration provided in config.CRLConf. It returns a RevocationFactory interface. The CRLHandler will have its CacheDisabled field set based on the configuration, and it will use a default HTTP client.

Jump to

Keyboard shortcuts

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