signing

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package signing manages Ed25519 key pairs used to sign and verify packages (.patchcord-plugin, .patchcord-app, .patchcord-bundle). It only deals with key material on disk — computing checksums, signing them, and verifying a signature against a package's content is internal/packaging's job; deciding whether a given public key is legitimate for a given package id is internal/trust's.

Index

Constants

View Source
const PublicKeyExtension = ".pub"

PublicKeyExtension is appended to a private key's path to name its public counterpart (e.g. "my-key" -> "my-key.pub"), the same convention ssh-keygen uses.

Variables

This section is empty.

Functions

func Fingerprint

func Fingerprint(pub ed25519.PublicKey) string

Fingerprint returns a short, human-comparable digest of pub for CLI output (e.g. "warn: signed by untrusted key <fingerprint>"). It is purely cosmetic — every actual trust decision (internal/trust.IsTrusted) compares the full public key, never this truncated form.

func GenerateKeyPair

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

GenerateKeyPair returns a new random Ed25519 key pair.

func LoadPrivateKey

func LoadPrivateKey(path string) (ed25519.PrivateKey, error)

LoadPrivateKey reads and decodes a private key file produced by WriteKeyPair.

func LoadPublicKey

func LoadPublicKey(path string) (ed25519.PublicKey, error)

LoadPublicKey reads and decodes a public key file produced by WriteKeyPair (path+PublicKeyExtension).

func WriteKeyPair

func WriteKeyPair(path string, pub ed25519.PublicKey, priv ed25519.PrivateKey) error

WriteKeyPair writes priv to path (base64, 0o600) and pub to path+PublicKeyExtension (base64, 0o644). The private key is written through a temp file + rename, so a reader never observes a partially written key file — same pattern as secrets.FileStore's vault writes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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