signing

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Overview

Package signing signs and verifies PE, Mach-O, and ELF binaries.

Index

Constants

View Source
const (
	TrustSystem     = "system trusted"
	TrustSelfSigned = "self-signed"
	TrustUntrusted  = "untrusted"
)

Certificate trust levels reported in Verification.Trust.

Variables

This section is empty.

Functions

func Sign

func Sign(options Options) (time.Duration, error)

Sign detects the binary format, signs the file, and verifies the result. It returns the time spent waiting for an interactive passphrase.

Types

type Options

type Options struct {
	Path          string
	SigningKey    string
	SigningChains []string
	Passphrase    string
	UserAgent     string
}

Options describes a binary signing operation.

type Verification

type Verification struct {
	Chain              []*x509.Certificate
	Trust              []string
	Timestamp          time.Time
	TimestampAuthority *x509.Certificate
}

Verification describes a verified binary signature. Trust holds, for each certificate in Chain, its trust level: "system trusted", "self-signed" or "untrusted".

func Verify

func Verify(options VerifyOptions) (*Verification, error)

Verify detects the binary format and verifies the file signature. When a certificate is supplied, the signing certificate must match it; otherwise the signature is verified against the system trust store alone. It returns the verified certificate chain, ordered from the signing certificate to the trust anchor, along with the timestamp authority.

type VerifyOptions

type VerifyOptions struct {
	Path              string
	Certificate       string
	CertificateChains []string
}

VerifyOptions describes a binary signature verification operation.

Jump to

Keyboard shortcuts

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