package zign

import "git.sr.ht/~pingoo/stdx/zign"

Index

Constants

const (
	Version1 = 1

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

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
}

Source Files

init.go manifest.go sign.go verify.go

Version
v0.0.0-20240218134121-094174641f6e (latest)
Published
Feb 18, 2024
Platform
linux/amd64
Imports
10 packages
Last checked
4 months ago

Tools for package owners.