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

hosttrust

package
v0.4.17 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 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)

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 State

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

type Status

type Status struct {
	Fingerprint string
	Trusted     bool
	Owned       bool
	Backend     string
	Path        string
}

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