core

package
v3.13.3 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEncodeJson      = AttestationClientError("json encoding")
	ErrReadPcr         = AttestationClientError("read pcr")
	ErrRootKey         = AttestationClientError("create or load root key")
	ErrAik             = AttestationClientError("create or load aik")
	ErrQuote           = AttestationClientError("tpm quote")
	ErrUnknown         = AttestationClientError("internal error")
	ErrEndorsementKey  = AttestationClientError("create or load EK")
	ErrEnroll          = AttestationClientError("internal enrollment error")
	ErrApiResponse     = AttestationClientError("unexpected api response")
	ErrOpenTrustAnchor = AttestationClientError("open trust anchor")
	ErrStateDir        = AttestationClientError("create or write state dir")
	ErrStateLoad       = AttestationClientError("other state load error")
	ErrStateStore      = AttestationClientError("other state store error")
	ErrUpdateConfig    = AttestationClientError("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 LogEnrollErrors added in v3.12.0

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

LogEnrollErrors 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

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

type AttestationClientError added in v3.12.0

type AttestationClientError string

func (AttestationClientError) Error added in v3.12.0

func (e AttestationClientError) Error() string

func (AttestationClientError) Is added in v3.12.0

func (e AttestationClientError) Is(target error) bool

Jump to

Keyboard shortcuts

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