bundle

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: Apache-2.0 Imports: 18 Imported by: 18

Documentation

Index

Constants

View Source
const IntotoMediaType = "application/vnd.in-toto+json"

Variables

View Source
var ErrDecodingB64 = fmt.Errorf("%w: decoding base64", ErrInvalidAttestation)
View Source
var ErrDecodingJSON = fmt.Errorf("%w: decoding json", ErrInvalidAttestation)
View Source
var ErrEmptyBundle = fmt.Errorf("%w: empty protobuf bundle", ErrValidation)
View Source
var ErrInvalidAttestation = fmt.Errorf("%w: invalid attestation", ErrValidation)
View Source
var ErrMissingBundleContent = fmt.Errorf("%w: missing bundle content", ErrValidation)
View Source
var ErrMissingEnvelope = fmt.Errorf("%w: missing valid envelope", ErrInvalidAttestation)
View Source
var ErrMissingVerificationMaterial = fmt.Errorf("%w: missing verification material", ErrValidation)
View Source
var ErrUnimplemented = errors.New("unimplemented")
View Source
var ErrUnsupportedMediaType = fmt.Errorf("%w: unsupported media type", ErrValidation)
View Source
var ErrValidation = errors.New("validation error")

Functions

func ErrValidationError

func ErrValidationError(err error) error

func MediaTypeString added in v0.4.0

func MediaTypeString(version string) (string, error)

MediaTypeString returns a mediatype string for the specified bundle version. The function returns an error if the resulting string does validate.

Types

type Bundle added in v0.6.0

type Bundle struct {
	*protobundle.Bundle
	// contains filtered or unexported fields
}

func LoadJSONFromPath

func LoadJSONFromPath(path string) (*Bundle, error)

func NewBundle added in v0.6.0

func NewBundle(pbundle *protobundle.Bundle) (*Bundle, error)

func (*Bundle) Envelope added in v0.6.0

func (b *Bundle) Envelope() (*Envelope, error)

func (*Bundle) HasInclusionPromise added in v0.6.0

func (b *Bundle) HasInclusionPromise() bool

func (*Bundle) HasInclusionProof added in v0.6.0

func (b *Bundle) HasInclusionProof() bool

func (*Bundle) MarshalJSON added in v0.6.0

func (b *Bundle) MarshalJSON() ([]byte, error)

func (*Bundle) MinVersion added in v0.6.0

func (b *Bundle) MinVersion(expectVersion string) bool

MinVersion returns true if the bundle version is greater than or equal to the expected version.

func (*Bundle) SignatureContent added in v0.6.0

func (b *Bundle) SignatureContent() (verify.SignatureContent, error)

func (*Bundle) Timestamps added in v0.6.0

func (b *Bundle) Timestamps() ([][]byte, error)

func (*Bundle) TlogEntries added in v0.6.0

func (b *Bundle) TlogEntries() ([]*tlog.Entry, error)

func (*Bundle) UnmarshalJSON added in v0.6.0

func (b *Bundle) UnmarshalJSON(data []byte) error

func (*Bundle) VerificationContent added in v0.6.0

func (b *Bundle) VerificationContent() (verify.VerificationContent, error)

type Certificate added in v0.3.0

type Certificate struct {
	*x509.Certificate
}

func (*Certificate) CompareKey added in v0.3.0

func (c *Certificate) CompareKey(key any, _ root.TrustedMaterial) bool

func (*Certificate) GetCertificate added in v0.5.0

func (c *Certificate) GetCertificate() *x509.Certificate

func (*Certificate) HasPublicKey added in v0.3.0

func (c *Certificate) HasPublicKey() (verify.PublicKeyProvider, bool)

func (*Certificate) ValidAtTime added in v0.3.0

func (c *Certificate) ValidAtTime(t time.Time, _ root.TrustedMaterial) bool

type Envelope

type Envelope struct {
	*dsse.Envelope
}

func (*Envelope) EnvelopeContent

func (e *Envelope) EnvelopeContent() verify.EnvelopeContent

func (*Envelope) MessageSignatureContent

func (e *Envelope) MessageSignatureContent() verify.MessageSignatureContent

func (*Envelope) RawEnvelope

func (e *Envelope) RawEnvelope() *dsse.Envelope

func (*Envelope) Signature

func (e *Envelope) Signature() []byte

func (*Envelope) Statement

func (e *Envelope) Statement() (*in_toto.Statement, error)

type MessageSignature

type MessageSignature struct {
	// contains filtered or unexported fields
}

func NewMessageSignature

func NewMessageSignature(digest []byte, digestAlgorithm string, signature []byte) *MessageSignature

func (*MessageSignature) Digest

func (m *MessageSignature) Digest() []byte

func (*MessageSignature) DigestAlgorithm

func (m *MessageSignature) DigestAlgorithm() string

func (*MessageSignature) EnvelopeContent

func (m *MessageSignature) EnvelopeContent() verify.EnvelopeContent

func (*MessageSignature) MessageSignatureContent

func (m *MessageSignature) MessageSignatureContent() verify.MessageSignatureContent

func (*MessageSignature) Signature

func (m *MessageSignature) Signature() []byte

type ProtobufBundle deprecated

type ProtobufBundle = Bundle

Deprecated: use Bundle instead

func NewProtobufBundle deprecated

func NewProtobufBundle(b *protobundle.Bundle) (*ProtobufBundle, error)

Deprecated: use NewBundle instead

type PublicKey

type PublicKey struct {
	// contains filtered or unexported fields
}

func (*PublicKey) CompareKey

func (pk *PublicKey) CompareKey(key any, tm root.TrustedMaterial) bool

func (*PublicKey) GetCertificate added in v0.5.0

func (pk *PublicKey) GetCertificate() *x509.Certificate

func (*PublicKey) HasPublicKey

func (pk *PublicKey) HasPublicKey() (verify.PublicKeyProvider, bool)

func (PublicKey) Hint

func (pk PublicKey) Hint() string

func (*PublicKey) ValidAtTime

func (pk *PublicKey) ValidAtTime(t time.Time, tm root.TrustedMaterial) bool

Jump to

Keyboard shortcuts

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