dsse

package
v0.0.1-alpha5 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: Apache-2.0 Imports: 6 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 Decode

func Decode(r io.Reader) (Envelope, error)

func Sign

func Sign(bodyType string, body io.Reader, signers ...crypto.Signer) (Envelope, error)

TODO: it'd be nice to break some of this logic out of what should be a presentation layer only

func (Envelope) Encode

func (e Envelope) Encode(w io.Writer) error

func (Envelope) Verify

func (e Envelope) Verify(verifiers ...crypto.Verifier) error

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 Signature

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

Jump to

Keyboard shortcuts

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