dsse

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const PemTypeCertificate = "CERTIFICATE"

Variables

This section is empty.

Functions

func TryParseCertificate added in v0.1.5

func TryParseCertificate(data []byte) (*x509.Certificate, error)

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, signers ...cryptoutil.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) Verify

func (e Envelope) Verify(opts ...VerificationOption) ([]cryptoutil.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"`
	// contains filtered or unexported fields
}

func NewSignature added in v0.1.6

func NewSignature(keyID string, sig []byte, opts ...SignatureOption) Signature

type SignatureOption added in v0.1.6

type SignatureOption func(so *signatureOptions)

func SignatureWithCertificate added in v0.1.6

func SignatureWithCertificate(certBytes []byte) SignatureOption

func SignatureWithIntermediates added in v0.1.6

func SignatureWithIntermediates(intermediates [][]byte) SignatureOption

func SignatureWithTrustedTime added in v0.1.6

func SignatureWithTrustedTime(trustedTime time.Time) SignatureOption

type VerificationOption

type VerificationOption func(*verificationOptions)

func WithIntermediates

func WithIntermediates(intermediates []*x509.Certificate) VerificationOption

func WithRoots

func WithRoots(roots []*x509.Certificate) VerificationOption

func WithVerifiers

func WithVerifiers(verifiers []cryptoutil.Verifier) VerificationOption

Jump to

Keyboard shortcuts

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