signer

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlpineRSASigner

type AlpineRSASigner struct {
	// contains filtered or unexported fields
}

AlpineRSASigner implements RSASigner interface for Alpine APK signing

func NewAlpineRSASigner

func NewAlpineRSASigner(keyPath, passphrase string) (*AlpineRSASigner, error)

NewAlpineRSASigner creates a new RSA signer for Alpine from a private key file

func (*AlpineRSASigner) GetPublicKey

func (s *AlpineRSASigner) GetPublicKey() ([]byte, error)

GetPublicKey returns the public key in PEM format

func (*AlpineRSASigner) SignRSA

func (s *AlpineRSASigner) SignRSA(data []byte) ([]byte, error)

SignRSA creates an RSA PKCS1v15 signature using SHA1 (Alpine APK standard)

type GPGSigner

type GPGSigner struct {
	// contains filtered or unexported fields
}

GPGSigner implements Signer interface using GPG

func NewGPGSigner

func NewGPGSigner(keyPath, passphrase string) (*GPGSigner, error)

NewGPGSigner creates a new GPG signer from a private key file

func (*GPGSigner) GetPublicKey

func (s *GPGSigner) GetPublicKey() ([]byte, error)

GetPublicKey returns the public key in armored format

func (*GPGSigner) SignCleartext

func (s *GPGSigner) SignCleartext(data []byte) ([]byte, error)

SignCleartext creates a cleartext signature (for Debian InRelease)

func (*GPGSigner) SignDetached

func (s *GPGSigner) SignDetached(data []byte) ([]byte, error)

SignDetached creates a detached ASCII-armored signature (for Debian Release.gpg, RPM repomd.xml.asc)

func (*GPGSigner) SignDetachedBinary

func (s *GPGSigner) SignDetachedBinary(data []byte) ([]byte, error)

SignDetachedBinary creates a detached binary signature (for Pacman .sig files) Pacman expects binary OpenPGP signatures in old packet format, not ASCII-armored ones We use GPG command-line to ensure compatibility with Pacman's expectations

func (*GPGSigner) SignDetachedBinaryFromFile

func (s *GPGSigner) SignDetachedBinaryFromFile(filePath string) ([]byte, error)

SignDetachedBinaryFromFile creates a detached binary signature directly from a file This avoids loading large files into memory

type RSASigner

type RSASigner interface {
	// SignRSA creates an RSA PKCS1v15 signature
	SignRSA(data []byte) ([]byte, error)

	// GetPublicKey returns the public key
	GetPublicKey() ([]byte, error)
}

RSASigner interface for RSA signing (Alpine APK)

func NewNilRSASigner

func NewNilRSASigner() RSASigner

NewNilRSASigner returns a nil RSA signer (for unsigned repositories)

type Signer

type Signer interface {
	// SignCleartext creates a cleartext signature (for Debian InRelease)
	SignCleartext(data []byte) ([]byte, error)

	// SignDetached creates a detached ASCII-armored signature (for Debian Release.gpg, RPM repomd.xml.asc)
	SignDetached(data []byte) ([]byte, error)

	// SignDetachedBinary creates a detached binary signature (for Pacman .sig files)
	SignDetachedBinary(data []byte) ([]byte, error)

	// SignDetachedBinaryFromFile creates a detached binary signature directly from a file
	// This avoids loading large files into memory
	SignDetachedBinaryFromFile(filePath string) ([]byte, error)

	// GetPublicKey returns the public key
	GetPublicKey() ([]byte, error)
}

Signer interface for signing repository metadata

func NewNilSigner

func NewNilSigner() Signer

NewNilSigner returns a nil signer (for unsigned repositories)

Jump to

Keyboard shortcuts

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