Help us shape the future of Go! Take the 2026 Go Developer Survey

hosttrust

package
v0.4.25 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Export

func Export(path string, pemData []byte) error

func ParseCA

func ParseCA(pemData []byte) (*x509.Certificate, string, error)

func RemoveOwned

func RemoveOwned(ctx context.Context, stateDir string) (int, error)

func UntrackedCandidates added in v0.4.24

func UntrackedCandidates(stateDir string) ([]string, error)

UntrackedCandidates reports BaseHarbor-named anchors which lack verified ownership evidence. Their names do NOT imply ownership and they are never eligible for automatic deletion.

Types

type AnchorRecord

type AnchorRecord struct {
	Fingerprint     string    `json:"fingerprint"`
	IssuerReference string    `json:"issuer_reference,omitempty"`
	Backend         string    `json:"backend"`
	Path            string    `json:"path"`
	InstalledAt     time.Time `json:"installed_at"`
}

func StateRecords

func StateRecords(stateDir string) ([]AnchorRecord, error)

type Backend

type Backend interface {
	Name() string
	AnchorPath(fingerprint string) (string, error)
	Install(context.Context, string, string) error
	Remove(context.Context, string) error
}

func DetectSystemBackend

func DetectSystemBackend() (Backend, error)

type RecordedStatus added in v0.4.24

type RecordedStatus struct {
	Fingerprint string `json:"fingerprint"`
	Backend     string `json:"backend"`
	State       string `json:"state"`
	Trusted     bool   `json:"trusted"`
}

InspectRecorded observes retained host anchors without requiring a live issuer. Ownership records alone never prove that a certificate still exists or matches.

func InspectRecorded added in v0.4.24

func InspectRecorded(stateDir string) ([]RecordedStatus, error)

type RemovalResult added in v0.4.24

type RemovalResult struct {
	Removed   []AnchorRecord `json:"removed,omitempty"`
	Preserved []AnchorRecord `json:"preserved,omitempty"`
	Untracked []string       `json:"preserved_untracked,omitempty"`
}

RemovalResult retains explicit evidence for every owned, preserved or refused CA.

func RemoveOwnedDetailed added in v0.4.24

func RemoveOwnedDetailed(ctx context.Context, stateDir string) (RemovalResult, error)

type State

type State struct {
	Version int            `json:"version"`
	Anchors []AnchorRecord `json:"anchors,omitempty"`
}

type Status

type Status struct {
	Fingerprint string `json:"fingerprint"`
	Trusted     bool   `json:"trusted"`
	Owned       bool   `json:"owned"`
	Backend     string `json:"backend,omitempty"`
	Path        string `json:"path,omitempty"`
}

func Inspect

func Inspect(stateDir string, pemData []byte) (Status, error)

func Install

func Install(ctx context.Context, stateDir string, pemData []byte, issuerReference string, backend Backend) (Status, error)

Jump to

Keyboard shortcuts

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