dsse

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const PemTypeCertificate = "CERTIFICATE"

Variables

This section is empty.

Functions

This section is empty.

Types

type Envelope

type Envelope struct {
	Payload     []byte      `json:"payload"`
	PayloadType string      `json:"payloadType"`
	Signatures  []Signature `json:"signatures"`
}

func Sign

func Sign(bodyType string, body io.Reader, opts ...SignOption) (Envelope, error)

func (Envelope) Verify

func (e Envelope) Verify(opts ...VerificationOption) ([]PassedVerifier, error)

type ErrInvalidThreshold added in v0.1.12

type ErrInvalidThreshold int

func (ErrInvalidThreshold) Error added in v0.1.12

func (e ErrInvalidThreshold) Error() string

type ErrNoMatchingSigs

type ErrNoMatchingSigs struct{}

func (ErrNoMatchingSigs) Error

func (e ErrNoMatchingSigs) Error() string

type ErrNoSignatures

type ErrNoSignatures struct{}

func (ErrNoSignatures) Error

func (e ErrNoSignatures) Error() string

type ErrThresholdNotMet added in v0.1.12

type ErrThresholdNotMet struct {
	Theshold int
	Acutal   int
}

func (ErrThresholdNotMet) Error added in v0.1.12

func (e ErrThresholdNotMet) Error() string

type PassedVerifier added in v0.1.14

type PassedVerifier struct {
	Verifier                 cryptoutil.Verifier
	PassedTimestampVerifiers []TimestampVerifier
}

type SignOption added in v0.1.14

type SignOption func(*signOptions)

func SignWithSigners added in v0.1.14

func SignWithSigners(signers ...cryptoutil.Signer) SignOption

func SignWithTimestampers added in v0.1.14

func SignWithTimestampers(timestampers ...Timestamper) SignOption

type Signature

type Signature struct {
	KeyID         string               `json:"keyid"`
	Signature     []byte               `json:"sig"`
	Certificate   []byte               `json:"certificate,omitempty"`
	Intermediates [][]byte             `json:"intermediates,omitempty"`
	Timestamps    []SignatureTimestamp `json:"timestamps,omitempty"`
}

type SignatureTimestamp added in v0.1.14

type SignatureTimestamp struct {
	Type SignatureTimestampType `json:"type"`
	Data []byte                 `json:"data"`
}

type SignatureTimestampType added in v0.1.14

type SignatureTimestampType string
const TimestampRFC3161 SignatureTimestampType = "tsp"

type TimestampVerifier added in v0.1.14

type TimestampVerifier interface {
	Verify(context.Context, io.Reader, io.Reader) (time.Time, error)
}

type Timestamper added in v0.1.14

type Timestamper interface {
	Timestamp(context.Context, io.Reader) ([]byte, error)
}

type VerificationOption

type VerificationOption func(*verificationOptions)

func VerifyWithIntermediates added in v0.1.14

func VerifyWithIntermediates(intermediates ...*x509.Certificate) VerificationOption

func VerifyWithRoots added in v0.1.14

func VerifyWithRoots(roots ...*x509.Certificate) VerificationOption

func VerifyWithThreshold added in v0.1.14

func VerifyWithThreshold(threshold int) VerificationOption

func VerifyWithTimestampVerifiers added in v0.1.14

func VerifyWithTimestampVerifiers(verifiers ...TimestampVerifier) VerificationOption

func VerifyWithVerifiers added in v0.1.14

func VerifyWithVerifiers(verifiers ...cryptoutil.Verifier) VerificationOption

Jump to

Keyboard shortcuts

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