signing

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const GoatKitPublicKey = "fa81e60073ee6f3e5825c575c18a7c2556f2abf2640dcf0e296a98fe4eb60fa6"

GoatKitPublicKey is the GoatKit publisher key. It signs the first-party plugins and the plugins bundled with GoatFlow, and is always trusted.

Variables

View Source
var ErrUntrusted = errors.New("plugin signature check failed")

ErrUntrusted marks plugin code refused because it is unsigned or not signed by a trusted key.

Functions

func DefaultSignaturePath

func DefaultSignaturePath(binaryPath string) string

DefaultSignaturePath returns the default signature file path for a binary. For binary "/path/to/plugin", returns "/path/to/plugin.sig"

func GenerateKeyPair

func GenerateKeyPair() (ed25519.PublicKey, ed25519.PrivateKey, error)

GenerateKeyPair generates a new ed25519 key pair for plugin signing.

func ParsePublicKey added in v0.11.0

func ParsePublicKey(hexKey string) (ed25519.PublicKey, error)

ParsePublicKey decodes a hex ed25519 public key.

func SignBinary

func SignBinary(binaryPath, outputSigPath string, privateKey ed25519.PrivateKey) error

SignBinary creates a signature file for a plugin binary. The signature file will be created at outputSigPath and contains the ed25519 signature of the binary's SHA-256 hash.

func VerifyBinary

func VerifyBinary(binaryPath, signaturePath string, trustedKeys []ed25519.PublicKey) error

VerifyBinary verifies a plugin binary against its signature file. Returns nil if the signature is valid and from a trusted key.

Types

type Verifier added in v0.11.0

type Verifier struct {
	// Required: a plugin binary (gRPC executable or WASM module) must carry a
	// .sig file from a trusted key, and a marketplace package must be signed.
	Required bool
	// Keys are the trusted publisher keys.
	Keys []ed25519.PublicKey
}

Verifier decides whether plugin code may be installed and run.

func VerifierFromEnv added in v0.11.0

func VerifierFromEnv() (Verifier, error)

VerifierFromEnv returns the configured verifier. Signatures are required unless GOATFLOW_REQUIRE_SIGNATURES is "0" or "false". The trusted keys are the GoatKit key plus GOATFLOW_TRUSTED_KEYS (comma-separated hex) and GOATFLOW_TRUSTED_KEYS_FILE (one hex key per line, # comments); an invalid key is an error rather than being skipped.

func (Verifier) Check added in v0.11.0

func (v Verifier) Check(path string) error

Check verifies the file at path against path+".sig" when signatures are required; otherwise it accepts the file.

Jump to

Keyboard shortcuts

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