trust

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

Variables

View Source
var (
	ErrKeyringRequired      = errors.New("package signing keyring is required")
	ErrKeyNotFound          = errors.New("package signing key not found")
	ErrKeyRevoked           = errors.New("package signing key is revoked")
	ErrPublicKeyInvalid     = errors.New("package signing public key is invalid")
	ErrSignatureRequired    = errors.New("package signature is required")
	ErrUnsupportedAlgorithm = errors.New("package signature algorithm is unsupported")
	ErrSignatureInvalid     = errors.New("package signature is invalid")
)

Functions

func CanonicalPackageSignaturePayload

func CanonicalPackageSignaturePayload(sig pluginpkg.PackageSignature) ([]byte, error)

func SignatureForPackage

func SignatureForPackage(pkg pluginpkg.Package, keyID string, publisherID string, pluginID string, privateKey ed25519.PrivateKey, signedAt time.Time) (pluginpkg.PackageSignature, error)

Types

type Ed25519Verifier

type Ed25519Verifier struct {
	Keyring Keyring
	Now     func() time.Time
}

type KeyLookupRequest

type KeyLookupRequest struct {
	Algorithm   string `json:"algorithm"`
	KeyID       string `json:"key_id"`
	PublisherID string `json:"publisher_id,omitempty"`
	PluginID    string `json:"plugin_id,omitempty"`
}

type Keyring

type Keyring interface {
	LookupPackageSigningKey(ctx context.Context, req KeyLookupRequest) (SigningKey, error)
}

type SigningKey

type SigningKey struct {
	Algorithm   string            `json:"algorithm"`
	KeyID       string            `json:"key_id"`
	PublisherID string            `json:"publisher_id,omitempty"`
	PluginID    string            `json:"plugin_id,omitempty"`
	PublicKey   ed25519.PublicKey `json:"-"`
	Revoked     bool              `json:"revoked,omitempty"`
	Metadata    map[string]string `json:"metadata,omitempty"`
}

type StaticKeyring

type StaticKeyring struct {
	Keys []SigningKey
}

func (StaticKeyring) LookupPackageSigningKey

func (k StaticKeyring) LookupPackageSigningKey(_ context.Context, req KeyLookupRequest) (SigningKey, error)

Jump to

Keyboard shortcuts

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