Documentation
¶
Overview ¶
Package intoto implements a parser and a statement variant for attestations in the in-toto format.
Index ¶
- type Parser
- type Statement
- func (s *Statement) AddSubject(sbj attestation.Subject)
- func (s *Statement) GetPredicate() attestation.Predicate
- func (s *Statement) GetPredicateType() attestation.PredicateType
- func (s *Statement) GetSubjects() []attestation.Subject
- func (s *Statement) GetVerification() attestation.Verification
- func (s *Statement) ParsePredicate() error
- func (s *Statement) ToJson() ([]byte, error)
- func (s *Statement) WriteJson(w io.Writer) error
- type StatementOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Parser ¶
type Parser struct{}
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 ¶
ParsePredicate reparses the underlying intoto predicate and regenerates the statement's predicate.
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
Click to show internal directories.
Click to hide internal directories.