multimeasurements

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package multimeasurements contains a helper to load a file with multiple measurements and compare provided measurements against them.

Compatible with measurements data schema v2 (see measurements.json) as well as the legacy v1 schema.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LegacyMultiMeasurements

type LegacyMultiMeasurements map[string]measurements.M

type MeasurementsContainer

type MeasurementsContainer struct {
	MeasurementID   string         `json:"measurement_id"`
	AttestationType string         `json:"attestation_type"`
	Measurements    measurements.M `json:"measurements"`
}

type MultiMeasurements

type MultiMeasurements struct {
	Measurements []MeasurementsContainer
}

MultiMeasurements holds several known measurements, and can check if given measurements match known ones.

func New

func New(path string) (m *MultiMeasurements, err error)

New returns a MultiMeasurements instance, with the measurements loaded from a file or URL.

func (*MultiMeasurements) Contains

func (m *MultiMeasurements) Contains(measurements map[uint32][]byte) (found bool, foundMeasurement *MeasurementsContainer)

Contains checks if the provided measurements match one of the known measurements. Any keys in the provided measurements which are not in the known measurements are ignored.

Jump to

Keyboard shortcuts

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