core

package
v3.11.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEncodeJson      = errors.New("json encoding")
	ErrReadPcr         = errors.New("read pcr")
	ErrRootKey         = errors.New("create or load root key")
	ErrAik             = errors.New("create or load aik")
	ErrQuote           = errors.New("tpm quote")
	ErrUnknown         = errors.New("internal error")
	ErrEndorsementKey  = errors.New("create or load EK")
	ErrEnroll          = errors.New("internal enrollment error")
	ErrApiResponse     = errors.New("unexpected api response")
	ErrOpenTrustAnchor = errors.New("open trust anchor")
	ErrStateDir        = errors.New("create or write state dir")
	ErrStateLoad       = errors.New("other state load error")
	ErrStateStore      = errors.New("other state store error")
	ErrUpdateConfig    = errors.New("fetch config from server")
)

Functions

func LogAttestErrors added in v3.11.0

func LogAttestErrors(l *zerolog.Logger, err error)

LogAttestErrors is a helper function to translate errors to text and log them directly

func LogInitErrors added in v3.11.0

func LogInitErrors(l *zerolog.Logger, err error)

LogInitErrors is a helper function to translate errors to text and log them directly

func LogUpdateConfigErrors added in v3.11.0

func LogUpdateConfigErrors(l *zerolog.Logger, err error)

LogUpdateConfigErrors is a helper function to translate errors to text and log them directly

Types

type AttestationClient added in v3.11.0

type AttestationClient struct {
	// program info
	ReleaseId *string

	// on-disk state
	State     *state.State
	StatePath string

	// API client
	Client api.Client

	// TPM
	EndorsementAuth string

	// Logging
	Log *zerolog.Logger
}

func NewCore added in v3.11.0

func NewCore() *AttestationClient

func (*AttestationClient) Attest added in v3.11.0

func (ac *AttestationClient) Attest(ctx context.Context, dryRun bool) (*api.Evidence, error)

func (*AttestationClient) Enroll added in v3.11.0

func (ac *AttestationClient) Enroll(ctx context.Context, token string, dummyTPM bool, tpmPath string) error

func (*AttestationClient) Init added in v3.11.0

func (ac *AttestationClient) Init(stateDir string, logger *zerolog.Logger) error

func (*AttestationClient) OverrideServerUrl added in v3.11.1

func (ac *AttestationClient) OverrideServerUrl(server *url.URL)

OverrideServerUrl sets URL in state re-inits the API client the changed URL becomes permanent when the state is stored, which happens during enroll and possibly when updating config

func (*AttestationClient) UpdateConfig added in v3.11.0

func (ac *AttestationClient) UpdateConfig() error

try to get a new configuration from server

Jump to

Keyboard shortcuts

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