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
- func CreateAndVerifyX509Certificate(cert, intermediateCACerts, rootCACert []byte) (*x509.Certificate, error)
- func CreateAndVerifyX509CertificateFromFiles(certPath, intermediateCACertsPath, rootCACertPath string) (*x509.Certificate, error)
- func RecursivelyAddDigestsToCd(cd *cdv2.ComponentDescriptor, repoContext cdv2.OCIRegistryRepository, ...) ([]*cdv2.ComponentDescriptor, error)
- func UploadCDPreservingLocalOciBlobs(ctx context.Context, cd cdv2.ComponentDescriptor, ...) error
- type Digester
- type SigningServerSigner
Constants ¶
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)