dsse

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: Apache-2.0 Imports: 10 Imported by: 6

Documentation

Index

Constants

View Source
const PemTypeCertificate = "CERTIFICATE"

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckedVerifier added in v0.4.0

type CheckedVerifier struct {
	Verifier           cryptoutil.Verifier
	TimestampVerifiers []timestamp.TimestampVerifier
	Error              error
}

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) ([]CheckedVerifier, error)

type ErrInvalidThreshold

type ErrInvalidThreshold int

func (ErrInvalidThreshold) Error

func (e ErrInvalidThreshold) Error() string

type ErrNoMatchingSigs

type ErrNoMatchingSigs struct {
	Verifiers []CheckedVerifier
}

func (ErrNoMatchingSigs) Error

func (e ErrNoMatchingSigs) Error() string

type ErrNoSignatures

type ErrNoSignatures struct{}

func (ErrNoSignatures) Error

func (e ErrNoSignatures) Error() string

type ErrThresholdNotMet

type ErrThresholdNotMet struct {
	Theshold int
	Actual   int
}

func (ErrThresholdNotMet) Error

func (e ErrThresholdNotMet) Error() string

type FailedVerifier added in v0.4.0

type FailedVerifier struct{}

type SignOption

type SignOption func(*signOptions)

func SignWithSigners

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

func SignWithTimestampers

func SignWithTimestampers(timestampers ...timestamp.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

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

type SignatureTimestampType

type SignatureTimestampType string
const TimestampRFC3161 SignatureTimestampType = "tsp"

type VerificationOption

type VerificationOption func(*verificationOptions)

func VerifyWithIntermediates

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

func VerifyWithRoots

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

func VerifyWithThreshold

func VerifyWithThreshold(threshold int) VerificationOption

func VerifyWithTimestampVerifiers

func VerifyWithTimestampVerifiers(verifiers ...timestamp.TimestampVerifier) VerificationOption

func VerifyWithVerifiers

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

Jump to

Keyboard shortcuts

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