gpgbin

package
v0.0.0-...-29413dc Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(r io.Reader) (*models.MessageDetails, error)

Decrypt runs gpg --decrypt on the contents of r. If the packet is signed, the signature is also verified

func Encrypt

func Encrypt(r io.Reader, to []string, from string) ([]byte, error)

Encrypt runs gpg --encrypt [--sign] -r [recipient]

func ExportPublicKey

func ExportPublicKey(k string) (io.Reader, error)

ExportPublicKey exports the public key identified by k in armor format

func GetKeyId

func GetKeyId(s string) (string, error)

GetKeyId runs gpg --list-keys s

func GetPrivateKeyId

func GetPrivateKeyId(s string) (string, error)

GetPrivateKeyId runs gpg --list-secret-keys s

func Import

func Import(r io.Reader) error

Import runs gpg --import and thus imports both private and public keys

func ImportOwnertrust

func ImportOwnertrust(r io.Reader) error

Import runs gpg --import-ownertrust and thus imports trusts for keys

func Sign

func Sign(r io.Reader, from string) ([]byte, string, error)

Sign creates a detached signature based on the contents of r

func Verify

func Verify(m io.Reader, s io.Reader) (*models.MessageDetails, error)

Verify runs gpg --verify. If s is not nil, then gpg interprets the arguments as a detached signature

Types

type StatusFdParsingError

type StatusFdParsingError int32
const (
	EncryptionFailed StatusFdParsingError = iota + 1
	MicalgNotFound
	NoValidOpenPgpData
)

func (StatusFdParsingError) Error

func (err StatusFdParsingError) Error() string

Jump to

Keyboard shortcuts

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