attestation

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PredicateType cattestation.PredicateType = "https://openvex.dev/ns/v0.2.0"

Functions

This section is empty.

Types

type Attestation

type Attestation struct {
	// Note that here, we are embedding the *intoto* Statement. Not to be
	// confused with the VEX Statement struct.
	//
	// Essentially our attestation is an extension of the intoto statement
	// with our custom predicate.
	*intoto.Statement

	// Predicate contains type specific metadata.
	Predicate *Predicate `json:"predicate"`
}

func New

func New() *Attestation

func (*Attestation) AddSubjects

func (att *Attestation) AddSubjects(subs []*intoto.ResourceDescriptor) error

AddSubjects adds a list of intoto subjects to the attestation

func (*Attestation) GetPredicate added in v0.2.8

func (att *Attestation) GetPredicate() cattestation.Predicate

func (*Attestation) GetPredicateType added in v0.2.8

func (att *Attestation) GetPredicateType() cattestation.PredicateType

func (*Attestation) GetSubjects added in v0.2.8

func (att *Attestation) GetSubjects() []cattestation.Subject

func (*Attestation) GetType added in v0.2.8

func (att *Attestation) GetType() string

func (*Attestation) GetVerification added in v0.2.8

func (att *Attestation) GetVerification() cattestation.Verification

func (*Attestation) MarshalJSON added in v0.2.8

func (att *Attestation) MarshalJSON() ([]byte, error)

MarshalJSON implements custom JSON marshaling for Attestation. It uses protojson to marshal the embedded in-toto Statement (which produces the correct field names like "_type" and "predicateType"), then replaces the predicate field with the output of the Predicate's own serialization.

func (*Attestation) ToJSON

func (att *Attestation) ToJSON(w io.Writer) error

ToJSON writes the attestation as JSON to the io.Writer w

type Predicate added in v0.2.8

type Predicate struct {
	vex.VEX
	// contains filtered or unexported fields
}

func NewPredicate added in v0.2.8

func NewPredicate(doc *vex.VEX) *Predicate

func (*Predicate) GetData added in v0.2.8

func (p *Predicate) GetData() []byte

func (*Predicate) GetOrigin added in v0.2.8

func (p *Predicate) GetOrigin() cattestation.Subject

func (*Predicate) GetParsed added in v0.2.8

func (p *Predicate) GetParsed() any

func (*Predicate) GetType added in v0.2.8

func (p *Predicate) GetType() cattestation.PredicateType

func (*Predicate) GetVerification added in v0.2.8

func (p *Predicate) GetVerification() cattestation.Verification

func (*Predicate) SetOrigin added in v0.2.8

func (p *Predicate) SetOrigin(org cattestation.Subject)

func (*Predicate) SetType added in v0.2.8

func (p *Predicate) SetType(t cattestation.PredicateType) error

func (*Predicate) SetVerification added in v0.2.8

func (p *Predicate) SetVerification(v cattestation.Verification)

Jump to

Keyboard shortcuts

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