sign

package
v0.0.0-...-09fc46a Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func HasSignature

func HasSignature(file string) (bool, error)

HasSignature checks if package has PGP/GPG signature

func IsSigned

func IsSigned(file string, privateKey *PrivateKey) (bool, error)

IsSigned checks if package is signed with given key

func Sign

func Sign(file, output string, privateKey *PrivateKey) error

Sign signs package with given private key Notice that encrypted private key must be decrypted before signing

Types

type Key

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

Key contains raw key data

func LoadKey

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

LoadKey loads private key data

func ReadKey

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

ReadKey securely reads signing key from file

func (*Key) Get

func (k *Key) Get(password *secstr.String) (*PrivateKey, error)

Get decrypts raw signing key and returns private key

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

type PrivateKey

type PrivateKey = packet.PrivateKey

PrivateKey represents a possibly encrypted private key

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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