signatures

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

SPDX-FileCopyrightText: 2022 SAP SE or an SAP affiliate company and Gardener contributors.

SPDX-License-Identifier: Apache-2.0

SPDX-FileCopyrightText: 2022 SAP SE or an SAP affiliate company and Gardener contributors.

SPDX-License-Identifier: Apache-2.0

SPDX-FileCopyrightText: 2022 SAP SE or an SAP affiliate company and Gardener contributors.

SPDX-License-Identifier: Apache-2.0

SPDX-FileCopyrightText: 2022 SAP SE or an SAP affiliate company and Gardener contributors.

SPDX-License-Identifier: Apache-2.0

Index

Constants

View Source
const (
	// http header
	AcceptHeader             = "Accept"
	HashAlgorithmHeader      = "X-Hash-Algorithm"
	SignatureAlgorithmHeader = "X-Signature-Algorithm"
)

Variables

This section is empty.

Functions

func CreateAndVerifyX509Certificate

func CreateAndVerifyX509Certificate(cert, intermediateCACerts, rootCACert []byte) (*x509.Certificate, error)

CreateAndVerifyX509Certificate creates and verifies a x509 certificate from in-memory raw certificates. The certificates must be in PEM format.

func CreateAndVerifyX509CertificateFromFiles

func CreateAndVerifyX509CertificateFromFiles(certPath, intermediateCACertsPath, rootCACertPath string) (*x509.Certificate, error)

CreateAndVerifyX509CertificateFromFiles creates and verifies a x509 certificate from certificate files. The certificates must be in PEM format.

func RecursivelyAddDigestsToCd

func RecursivelyAddDigestsToCd(cd *cdv2.ComponentDescriptor, repoContext cdv2.OCIRegistryRepository, ociClient ociclient.Client, blobResolvers map[string]ctf.BlobResolver, ctx context.Context, skipAccessTypes map[string]bool) ([]*cdv2.ComponentDescriptor, error)

func UploadCDPreservingLocalOciBlobs

func UploadCDPreservingLocalOciBlobs(ctx context.Context, cd cdv2.ComponentDescriptor, targetRepository cdv2.OCIRegistryRepository, ociClient ociclient.ExtendedClient, cache ociCache.Cache, blobResolvers map[string]ctf.BlobResolver, force bool, log logr.Logger) error

Types

type Digester

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

func NewDigester

func NewDigester(ociClient ociclient.Client, hasher signatures.Hasher) *Digester

func (*Digester) DigestForResource

func (d *Digester) DigestForResource(ctx context.Context, cd cdv2.ComponentDescriptor, res cdv2.Resource) (*cdv2.DigestSpec, error)

type SigningServerSigner

type SigningServerSigner struct {
	ServerURL   string
	ClientCert  *tls.Certificate
	RootCACerts []byte
}

func NewSigningServerSigner

func NewSigningServerSigner(serverURL, clientCertPath, privateKeyPath, rootCACertsPath string) (*SigningServerSigner, error)

func (*SigningServerSigner) Sign

func (signer *SigningServerSigner) Sign(componentDescriptor cdv2.ComponentDescriptor, digest cdv2.DigestSpec) (*cdv2.SignatureSpec, error)

Jump to

Keyboard shortcuts

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