Documentation ¶
Index ¶
- type Envelope
- type Predicate
- type PredicateImplementation
- type Statement
- func (s *Statement) AddSubject(uri string, ds common.DigestSet)
- func (s *Statement) AddSubjectFromFile(filePath string) error
- func (s *Statement) ClonePredicate(manifestPath string) error
- func (s *Statement) LoadPredicate(path string) error
- func (s *Statement) ReadSubjectsFromDir(path string) (err error)
- func (s *Statement) SetImplementation(si StatementImplementation)
- func (s *Statement) ToJSON() ([]byte, error)
- func (s *Statement) VerifySubjects(path string) (err error)
- func (s *Statement) Write(path string) error
- type StatementImplementation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Envelope ¶
type Envelope struct { PayloadType string `json:"payloadType"` Payload string `json:"payload"` Signatures []interface{} `json:"signatures"` }
Envelope is the outermost layer of the attestation, handling authentication and serialization. The format and protocol are defined in DSSE and adopted by in-toto in ITE-5. https://github.com/in-toto/attestation/blob/main/spec/README.md#envelope
type Predicate ¶
type Predicate struct { slsa.ProvenancePredicate // contains filtered or unexported fields }
func NewSLSAPredicate ¶
func NewSLSAPredicate() Predicate
NewSLSAPredicate returns a new SLSA provenance predicate
func (*Predicate) AddMaterial ¶
AddMaterial adds an entry to the listo of materials
func (*Predicate) SetImplementation ¶
func (p *Predicate) SetImplementation(impl PredicateImplementation)
setImplementation sets the predicate implementation
type PredicateImplementation ¶
type Statement ¶
type Statement struct { intoto.StatementHeader Predicate Predicate `json:"predicate"` // contains filtered or unexported fields }
Statement is the middle layer of the attestation, binding it to a particular subject and unambiguously identifying the types of the predicate. https://github.com/in-toto/attestation/blob/main/spec/README.md#statement
func LoadStatement ¶
LoadStatement loads a statement from a json file
func NewSLSAStatement ¶
func NewSLSAStatement() *Statement
NewSLSAStatement creates a new attestation
func (*Statement) AddSubject ¶
AddSubject adds an entry to the listo of materials
func (*Statement) AddSubjectFromFile ¶
AddSubjectFromFile adds a subject to the list by checking a file in the filesystem
func (*Statement) ClonePredicate ¶
ClonePredicate reads a provenance metadata file from `manifestPath` and clones the predicate data to the current object.
func (*Statement) LoadPredicate ¶
LoadPredicate loads a predicate from a json file
func (*Statement) ReadSubjectsFromDir ¶
ReadSubjectsFromDir reads a directory and adds every file as a subject to the statement.
func (*Statement) SetImplementation ¶
func (s *Statement) SetImplementation(si StatementImplementation)
func (*Statement) VerifySubjects ¶
VerifySubjects checks the provenance metadata of the attestation subjects by reading them from `path`.
type StatementImplementation ¶
type StatementImplementation interface { AddSubject(*Statement, string, common.DigestSet) ReadSubjectsFromDir(*Statement, string) error SubjectFromFile(string) (intoto.Subject, error) Write(*Statement, string) error ToJSON(s *Statement) ([]byte, error) ClonePredicate(*Statement, string) error VerifySubjects(path string, subjects *[]intoto.Subject) (err error) }