initdata

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package initdata handles generation of initdata for Confidential Containers.

Index

Constants

View Source
const (
	InitDataVersion   = "0.1.0"
	InitDataAlgorithm = "sha256"
)

InitData constants define the version and algorithm for initdata generation

Variables

View Source
var ValidAlgorithms = []string{"sha256", "sha384", "sha512"}

ValidAlgorithms lists all hash algorithms accepted during initdata validation.

Functions

func Decode added in v0.14.0

func Decode(encoded string) (map[string]string, error)

Decode decodes a base64+gzip encoded initdata string and returns the data map.

func Generate

func Generate(cfg *config.CocoConfig, imagePullSecrets []ImagePullSecretInfo) (string, error)

Generate creates initdata based on the CoCo configuration.

func GenerateRaw added in v0.14.0

func GenerateRaw(cfg *config.CocoConfig, certPEM string, imagePullSecrets []ImagePullSecretInfo) ([]byte, error)

GenerateRaw returns the raw initdata TOML bytes without gzip/base64 encoding. When certPEM is non-empty it is used directly instead of reading cfg.TrusteeCACert.

func IsValidAlgorithm added in v0.14.0

func IsValidAlgorithm(alg string) bool

IsValidAlgorithm reports whether alg is an accepted initdata algorithm.

Types

type ImagePullSecretInfo added in v0.5.0

type ImagePullSecretInfo struct {
	Namespace  string
	SecretName string
	Key        string
}

ImagePullSecretInfo holds information about imagePullSecrets for initdata generation

type InitData

type InitData struct {
	Algorithm string            `toml:"algorithm"`
	Version   string            `toml:"version"`
	Data      map[string]string `toml:"data"`
}

InitData represents the structure of initdata TOML. The [data] section holds the embedded configuration files keyed by filename.

Jump to

Keyboard shortcuts

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