idkeydigest

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 idkeydigest provides type definitions for the `idkeydigest` value of SEV-SNP attestation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Enforcement

type Enforcement uint32

Enforcement defines the behavior of the validator when the ID key digest is not found in the expected list.

const (
	// Unknown is reserved for invalid configurations.
	Unknown Enforcement = iota
	// Equal will error if the reported signing key digest does not match any of the values in 'acceptedKeyDigests'.
	Equal
	// MAAFallback uses 'equal' checking for validation, but fallback to using Microsoft Azure Attestation (MAA)
	// for validation if the reported digest does not match any of the values in 'acceptedKeyDigests'.
	MAAFallback
	// WarnOnly is the same as 'equal', but only prints a warning instead of returning an error if no match is found.
	WarnOnly
)

func EnforcePolicyFromString

func EnforcePolicyFromString(s string) Enforcement

EnforcePolicyFromString returns Enforcement from string.

func (Enforcement) MarshalJSON

func (e Enforcement) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (Enforcement) MarshalYAML

func (e Enforcement) MarshalYAML() (any, error)

MarshalYAML implements the yaml.Marshaler interface.

func (Enforcement) String

func (i Enforcement) String() string

func (*Enforcement) UnmarshalJSON

func (e *Enforcement) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

func (*Enforcement) UnmarshalYAML

func (e *Enforcement) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

type List

type List [][]byte

List is a list of trusted digest values for the ID key.

func DefaultList

func DefaultList() List

DefaultList returns the default list of accepted ID key digests.

func NewList

func NewList(digests [][]byte) List

NewList creates a new IDKeyDigests from a list of digests.

func UnmarshalHexString

func UnmarshalHexString(encodedDigests []string) (List, error)

UnmarshalHexString unmarshals a list of hex encoded ID key digest strings.

func (List) EqualTo

func (d List) EqualTo(other List) bool

EqualTo returns true if the List of digests is equal to the other List.

func (List) MarshalJSON

func (d List) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (List) MarshalYAML

func (d List) MarshalYAML() (any, error)

MarshalYAML implements the yaml.Marshaler interface.

func (*List) UnmarshalJSON

func (d *List) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

func (*List) UnmarshalYAML

func (d *List) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

Jump to

Keyboard shortcuts

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