advancedtrust

package
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package advancedtrust imports and owns the local, Owner-approved trust roots used by offline Advanced capability verification.

Index

Constants

View Source
const (
	BundleSchemaVersion = "stackkit.advanced-trust-bundle/v1"
)
View Source
const (
	RecordSchemaVersion = "stackkit.local-advanced-trust/v1"
)

Variables

View Source
var ErrMissing = errors.New("advancedtrust: no local Advanced trust bundle")

ErrMissing reports that no local Advanced trust bundle has been imported.

Functions

func Decode

func Decode(raw []byte) (advancedcapability.TrustBundle, error)

Decode strictly decodes the canonical public trust-bundle wire contract. The returned bundle is detached from raw and contains public verification keys only.

Types

type Inspection

type Inspection struct {
	SchemaVersion string         `json:"schemaVersion"`
	BundleSHA256  string         `json:"bundleSHA256"`
	ImportedAt    time.Time      `json:"importedAt"`
	OwnerRef      string         `json:"ownerRef"`
	OwnerKeyID    string         `json:"ownerKeyId"`
	Keys          []KeyReference `json:"keys"`
}

Inspection is a secret- and key-material-free view suitable for CLI output.

func Inspect

func Inspect(workspace string) (Inspection, error)

Inspect returns only issuer/key identifiers and verified record metadata. It never returns raw public-key or signature material.

type KeyReference

type KeyReference struct {
	IssuerID string `json:"issuerId"`
	KeyID    string `json:"keyId"`
}

KeyReference identifies a trusted public key without returning its bytes.

type Record

type Record struct {
	SchemaVersion string    `json:"schemaVersion"`
	Kind          string    `json:"kind"`
	BundleSHA256  string    `json:"bundleSHA256"`
	ImportedAt    time.Time `json:"importedAt"`
	OwnerRef      string    `json:"ownerRef"`
	OwnerKeyID    string    `json:"ownerKeyId"`
	KeyCount      int       `json:"keyCount"`
	// contains filtered or unexported fields
}

Record is the verified, Owner-bound local trust record. Raw public key material is deliberately not exported or JSON-serializable; callers must explicitly request a detached verifier bundle.

func Import

func Import(workspace string, raw []byte, expectedSHA256 string, now time.Time) (Record, error)

Import verifies an exact SHA-256 pin before creating any trust-store state, binds the canonical bundle to current Owner custody, and atomically installs the private local record.

func Load

func Load(workspace string) (Record, error)

Load returns only after strict wire, SHA-256, local Owner binding, signature, private permission, and stable-read verification succeeds.

func (Record) TrustBundle

func (record Record) TrustBundle() advancedcapability.TrustBundle

TrustBundle returns a detached public-key bundle for offline capability verification. Mutating it cannot alter the loaded record.

Jump to

Keyboard shortcuts

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