intoto

package
v0.0.0-...-1510307 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BundleFilename = "bundle.json"
	ReadOnlyMask   = 0400
)

Variables

This section is empty.

Functions

func GetMetadataRawMessage

func GetMetadataRawMessage(layout string, linkDir string, layoutKey string) (canonicaljson.RawMessage, error)

GetMetadataRawMessage takes In-Toto metadata and returns a canonical RawMessage that can be stored in the TUF targets custom field.

TODO: layout signing key should not be passed by the library. Layouts should be signed with the targets key used to sign the TUF collection.

func ValidateFromPath

func ValidateFromPath(p string) error

ValidateFromPath validates a layout given a path

func ValidateLayout

func ValidateLayout(layout in_toto.Layout) error

ValidateLayout is a function used to ensure that a passed item of type Layout matches the necessary format.

func VerifyInContainer

func VerifyInContainer(target *client.TargetWithRole, bundle []byte, verificationImage string, logLevel string) error

func VerifyOnOS

func VerifyOnOS(target *client.TargetWithRole, bundle []byte) error

func WriteMetadataFiles

func WriteMetadataFiles(m *Metadata, dir string) error

WriteMetadataFiles writes the content of a metadata object into files in a directory

Types

type Metadata

type Metadata struct {
	// TODO: remove this once the TUF targets key is used to sign the root layout
	Key    []byte            `json:"key"`
	Layout []byte            `json:"layout"`
	Links  map[string][]byte `json:"links"`
}

Metadata represents the In-Toto metadata stored in TUF. All fields are represented as []byte in order to be stored in the Custom field for TUF metadata.

Jump to

Keyboard shortcuts

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