zign

package
v0.0.0-...-0941746 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

README

zign

zign is a library and command-line utility to sign files and verify signatures. It's especially to check for the integrity and legitimacy of binary file ooffered for download

See tool/zign for the accompanying CLI tool.

Documentation

Index

Constants

View Source
const (
	Version1 = 1

	DefaultManifestFilename = "zign.json"
)
View Source
const SaltSize = crypto.KeySize256

Variables

This section is empty.

Functions

func Init

func Init(password []byte) (encryptedAndEncodedPrivateKey string, encodedPublicKey string, err error)

func Verify

func Verify(base64PublicKey string, input VerifyInput) (err error)

func VerifyMany

func VerifyMany(base64PublicKey string, input []VerifyInput) (err error)

Types

type Manifest

type Manifest struct {
	Version uint64       `json:"version"`
	Files   []SignOutput `json:"files"`
}

func GenerateManifest

func GenerateManifest(signOutput []SignOutput) (manifest Manifest)

func (Manifest) ToJson

func (manifest Manifest) ToJson() (manifestJSON []byte, err error)

type SignInput

type SignInput struct {
	Filename string
	Reader   io.Reader
}

type SignOutput

type SignOutput struct {
	Filename   string `json:"file"`
	HashBlake3 string `json:"hash_blake3"`
	Signature  []byte `json:"signature"`
}

func Sign

func Sign(encryptedBase64PrivateKey string, password string, input SignInput) (output SignOutput, err error)

func SignMany

func SignMany(encryptedBase64PrivateKey string, password string, input []SignInput) (output []SignOutput, err error)

type VerifyInput

type VerifyInput struct {
	Reader     io.Reader
	HashBlake3 []byte
	Signature  []byte
}

Jump to

Keyboard shortcuts

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