sign

package
v3.3.5 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeyIsEncrypted = fmt.Errorf("Key is encrypted (decrypted key is required)")
	ErrKeyIsNil       = fmt.Errorf("Key is nil")
	ErrKeyIsEmpty     = fmt.Errorf("Key is empty")
	ErrKeyringIsEmpty = fmt.Errorf("Keyring is empty (there is no private key)")
)

Functions

func IsPackageSignatureValid added in v3.2.0

func IsPackageSignatureValid(pkgFile string, key *Key) (bool, error)

IsPackageSignatureValid checks if package is signed with given key

func IsPackageSigned added in v3.2.0

func IsPackageSigned(pkgFile string) (bool, error)

IsPackageSigned checks if package has PGP/GPG signature

func SignFile added in v3.2.0

func SignFile(file string, key *Key) error

SignFile generates asc file with PGP signature

func SignPackage added in v3.2.0

func SignPackage(pkgFile, output string, key *Key) error

SignPackage signs package with given private key Notice that encrypted private key MUST BE decrypted before signing

Types

type ArmoredKey added in v3.2.0

type ArmoredKey struct {
	IsEncrypted bool
	// contains filtered or unexported fields
}

ArmoredKey contains raw key data

func LoadKey

func LoadKey(data []byte) (*ArmoredKey, error)

LoadKey loads private key data

func ReadKey

func ReadKey(file string) (*ArmoredKey, error)

ReadKey securely reads signing key from file

func (*ArmoredKey) Read added in v3.2.0

func (k *ArmoredKey) Read(password *secstr.String) (*Key, error)

Read reads and decrypts (if password is provided) raw OpenPGP key

You MUST NOT decrypt signing key (provide password) for checking package signature. Decrypted signing key ONLY required for signing packages/meta.

type Key

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

Key contains parsed OpenGPG entity

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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