pgp

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEntityList

func GetEntityList(armored []byte) (openpgp.EntityList, error)

func MessageDecrypt

func MessageDecrypt(entityList openpgp.EntityList, encrypted []byte) ([]byte, error)

func MessageEncrypt

func MessageEncrypt(entityList openpgp.EntityList, message []byte) ([]byte, error)

func PrivateKeyDecrypt

func PrivateKeyDecrypt(entity *openpgp.Entity, passphrase []byte) (*openpgp.Entity, error)

func Sign

func Sign(entity *openpgp.Entity, message []byte) ([]byte, error)

func StreamDecrypt

func StreamDecrypt(entityList openpgp.EntityList, src io.Reader, dst io.Writer) error

func StreamEncrypt

func StreamEncrypt(entityList openpgp.EntityList, src io.Reader, dst io.Writer) error

func Unarmor

func Unarmor(input string) (*armor.Block, error)

func Verify

func Verify(entity *openpgp.Entity, message []byte, signature []byte) error

Types

type Config

type Config struct {
	packet.Config
	// Expiry is the duration that the generated key will be valid for.
	Expiry time.Duration
}

Config for generating keys.

type Key

type Key struct {
	openpgp.Entity
}

Key represents an OpenPGP key.

func CreateKey

func CreateKey(name, comment, email string, config *Config) (*Key, error)

func (*Key) Armor

func (key *Key) Armor() (string, error)

func (*Key) ArmorPrivate

func (key *Key) ArmorPrivate(config *Config) (string, error)

func (*Key) Keyring

func (key *Key) Keyring() []byte

func (*Key) Secring

func (key *Key) Secring(config *Config) []byte

Jump to

Keyboard shortcuts

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