endorser

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package endorser provides a function for generating an endorsement statement for a binary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateEndorsement

func GenerateEndorsement(referenceValues *verification.ReferenceValues, validityDuration claims.ClaimValidity, provenances []ParsedProvenance) (*intoto.Statement, error)

GenerateEndorsement generates an endorsement statement for the given validity duration, using the given provenances as evidence and reference values to verify them. At least one provenance must be provided. The endorsement statement is generated only if the provenance statements are valid.

func GetProvenanceBytes

func GetProvenanceBytes(provenanceURI string) ([]byte, error)

GetProvenanceBytes fetches provenance bytes from the give URI. Supported URI schemes are "http", "https", and "file". Only local files are supported.

Types

type ParsedProvenance

type ParsedProvenance struct {
	Provenance     model.ProvenanceIR
	SourceMetadata claims.ProvenanceData
}

ParsedProvenance contains a provenance in the internal ProvenanceIR format, and metadata about the source of the provenance. In case of a provenance wrapped in a DSSE envelope, `SourceMetadata` contains the URI and digest of the DSSE document, while `Provenance` contains the provenance itself.

func LoadProvenance

func LoadProvenance(provenanceURI string) (*ParsedProvenance, error)

LoadProvenance loads a provenance from the give URI (either a local file or a remote file on an HTTP/HTTPS server). Returns an instance of ParsedProvenance if loading and parsing is successful, or an error Otherwise.

func LoadProvenances

func LoadProvenances(provenanceURIs []string) ([]ParsedProvenance, error)

LoadProvenances loads a number of provenance from the give URIs. Returns an array of ParsedProvenance instances, or an error if loading or parsing any of the provenances fails. See LoadProvenance for more details.

Jump to

Keyboard shortcuts

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