intoto

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: Apache-2.0 Imports: 11 Imported by: 7

Documentation

Overview

Package intoto implements a parser and a statement variant for attestations in the in-toto format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser struct{}

func (*Parser) Parse

func (p *Parser) Parse(b []byte) (attestation.Statement, error)

func (*Parser) ParseBase64

func (p *Parser) ParseBase64(b []byte) (attestation.Statement, error)

type Statement

type Statement struct {
	PredicateType attestation.PredicateType `json:"predicateType"`
	Predicate     attestation.Predicate     `json:"predicate"`
	Type          string                    `json:"_type"`
	gointoto.Statement
}

func NewStatement

func NewStatement(opts ...StatementOption) *Statement

func (*Statement) AddSubject

func (s *Statement) AddSubject(sbj attestation.Subject)

func (*Statement) GetPredicate

func (s *Statement) GetPredicate() attestation.Predicate

func (*Statement) GetPredicateType

func (s *Statement) GetPredicateType() attestation.PredicateType

func (*Statement) GetSubjects

func (s *Statement) GetSubjects() []attestation.Subject

GetSubjects returns the statement's subjects

func (*Statement) GetVerification

func (s *Statement) GetVerification() attestation.Verification

GetVerifications returns the verifications from the underlying predicate

func (*Statement) ParsePredicate

func (s *Statement) ParsePredicate() error

ParsePredicate reparses the underlying intoto predicate and regenerates the statement's predicate.

func (*Statement) ToJson

func (s *Statement) ToJson() ([]byte, error)

ToJson returns a byte slice with the predicate in JSON

func (*Statement) WriteJson

func (s *Statement) WriteJson(w io.Writer) error

type StatementOption

type StatementOption func(*Statement)

var _ attestation.Subject = (*Subject)(nil)

func WithPredicate

func WithPredicate(pred attestation.Predicate) StatementOption

func WithSubject

func WithSubject(subjects ...*gointoto.ResourceDescriptor) StatementOption

Jump to

Keyboard shortcuts

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