verify

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FormatBinary   = "binary"
	FormatPGP      = "pgp"
	FormatMinisign = "minisign"
)

Variables

This section is empty.

Functions

func DetectChecksumAlgorithm

func DetectChecksumAlgorithm(filename, defaultAlgo string) string

func DetectChecksumType

func DetectChecksumType(filename string) string

DetectChecksumType determines if a checksum file is consolidated or per-asset.

func ExtractChecksum

func ExtractChecksum(data []byte, algo, assetName string) (string, error)

func FindChecksumSignature

func FindChecksumSignature(assets []model.Asset, cfg *model.RepoConfig) (*model.Asset, string)

FindChecksumSignature looks for a signature over the checksum file (Workflow A). It searches for assets matching the ChecksumSigCandidates patterns. Returns the signature asset and the corresponding checksum asset name, or nil if not found.

func FormatSize

func FormatSize(bytes int64) string

FormatSize formats bytes as human-readable size.

func NormalizeHexKey

func NormalizeHexKey(input string) (string, error)

func SignatureFormatFromExtension

func SignatureFormatFromExtension(filename string, formats model.SignatureFormats) string

SignatureFormatFromExtension determines the signature verification method from file extension. Returns one of FormatMinisign, FormatPGP, FormatBinary, or empty string if unknown.

func VerifyMinisignSignature

func VerifyMinisignSignature(contentToVerify []byte, sigPath, pubKeyPath string) error

func VerifyPGPSignature

func VerifyPGPSignature(assetPath, sigPath, pubKeyPath, gpgBin string) error

Types

type SignatureData

type SignatureData struct {
	Format string
	Bytes  []byte
}

func LoadSignature

func LoadSignature(path string) (SignatureData, error)

Jump to

Keyboard shortcuts

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