Documentation ¶
Index ¶
- Constants
- Variables
- func ErrValidationError(err error) error
- func MediaTypeString(version string) (string, error)
- type Bundle
- func (b *Bundle) Envelope() (*Envelope, error)
- func (b *Bundle) HasInclusionPromise() bool
- func (b *Bundle) HasInclusionProof() bool
- func (b *Bundle) MarshalJSON() ([]byte, error)
- func (b *Bundle) MinVersion(expectVersion string) bool
- func (b *Bundle) SignatureContent() (verify.SignatureContent, error)
- func (b *Bundle) Timestamps() ([][]byte, error)
- func (b *Bundle) TlogEntries() ([]*tlog.Entry, error)
- func (b *Bundle) UnmarshalJSON(data []byte) error
- func (b *Bundle) VerificationContent() (verify.VerificationContent, error)
- type Certificate
- type Envelope
- type MessageSignature
- type ProtobufBundledeprecated
- type PublicKey
- func (pk *PublicKey) CompareKey(key any, tm root.TrustedMaterial) bool
- func (pk *PublicKey) GetCertificate() *x509.Certificate
- func (pk *PublicKey) HasPublicKey() (verify.PublicKeyProvider, bool)
- func (pk PublicKey) Hint() string
- func (pk *PublicKey) ValidAtTime(t time.Time, tm root.TrustedMaterial) bool
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 MediaTypeString ¶ added in v0.4.0
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 (*Bundle) HasInclusionPromise ¶ added in v0.6.0
func (*Bundle) HasInclusionProof ¶ added in v0.6.0
func (*Bundle) MarshalJSON ¶ added in v0.6.0
func (*Bundle) MinVersion ¶ added in v0.6.0
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 (*Bundle) UnmarshalJSON ¶ added in v0.6.0
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 ¶
func (*Envelope) EnvelopeContent ¶
func (e *Envelope) EnvelopeContent() verify.EnvelopeContent
func (*Envelope) MessageSignatureContent ¶
func (e *Envelope) MessageSignatureContent() verify.MessageSignatureContent
func (*Envelope) RawEnvelope ¶
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) ValidAtTime ¶
Click to show internal directories.
Click to hide internal directories.