git

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SignCommit

func SignCommit(cfg *config.Config, localUser string, statusFd int) error

SignCommit signs commit data from stdin and writes signature to stdout. This implements the gpgsm-compatible signing interface expected by Git. If a bridge cert is present (Level 1+), the CMS signature includes it as an intermediate cert: master → bridge → ephemeral → commit.

func VerifySignature

func VerifySignature(cfg *config.Config, sigFile, dataFile string, statusFd int) error

VerifySignature verifies a CMS signature for Git compatibility

Types

type Identity

type Identity struct {
	MasterKey *keys.Ed25519Signer
	MachineID string

	// Optional user attribution (Level 1+)
	BridgeCert *x509.Certificate
	BridgeKey  *keys.SecurePrivateKey
}

Identity represents a signing identity with optional user attribution. Level 0: machine identity only (MasterKey). Level 1+: machine identity + bridge cert for user attribution.

func LoadIdentity

func LoadIdentity(cfg *config.Config) (*Identity, error)

LoadIdentity loads the signing identity from configuration. It always loads the machine master key (Level 0). If bridge cert/key files exist under cfg.Home/git/, they are loaded for Level 1+.

func (*Identity) Destroy

func (i *Identity) Destroy()

Destroy zeroizes sensitive key material.

func (*Identity) HasUserAttribution

func (i *Identity) HasUserAttribution() bool

HasUserAttribution returns true if a bridge cert is configured.

func (*Identity) Level

func (i *Identity) Level() int

Level returns the identity disclosure level (0 or 1).

Jump to

Keyboard shortcuts

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