package bundle

import "github.com/sigstore/sigstore-go/pkg/bundle"

Index

Constants

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

Variables

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

Functions

func ErrValidationError

func ErrValidationError(err error) error

func MediaTypeString

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

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

func LoadJSONFromPath

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

func NewBundle

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

func (*Bundle) Envelope

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

func (*Bundle) HasInclusionPromise

func (b *Bundle) HasInclusionPromise() bool

func (*Bundle) HasInclusionProof

func (b *Bundle) HasInclusionProof() bool

func (*Bundle) MarshalJSON

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

func (*Bundle) MinVersion

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

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

func (*Bundle) Timestamps

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

func (*Bundle) TlogEntries

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

func (*Bundle) UnmarshalJSON

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

func (*Bundle) VerificationContent

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

func (*Bundle) Version

func (b *Bundle) Version() (string, error)

type Certificate

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

func NewCertificate

func NewCertificate(cert *x509.Certificate) *Certificate

func (*Certificate) Certificate

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

func (*Certificate) CompareKey

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

func (*Certificate) PublicKey

func (c *Certificate) PublicKey() verify.PublicKeyProvider

func (*Certificate) ValidAtTime

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

type ProtobufBundle = Bundle

Deprecated: use Bundle instead

func NewProtobufBundle

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

Deprecated: use NewBundle instead

type PublicKey

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

func (*PublicKey) Certificate

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

func (*PublicKey) CompareKey

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

func (PublicKey) Hint

func (pk PublicKey) Hint() string

func (*PublicKey) PublicKey

func (pk *PublicKey) PublicKey() verify.PublicKeyProvider

func (*PublicKey) ValidAtTime

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

Source Files

bundle.go signature_content.go verification_content.go

Version
v1.1.1 (latest)
Published
Aug 5, 2025
Platform
linux/amd64
Imports
18 packages
Last checked
8 months ago

Tools for package owners.