cli

package
v1.6.9 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2018 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Binary string
	Args   []string
	Umask  int
}

Config is the gpg wrapper config

type GPG

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

GPG is a gpg wrapper

func New

func New(ctx context.Context, cfg Config) (*GPG, error)

New creates a new GPG wrapper

func (*GPG) Binary added in v1.5.1

func (g *GPG) Binary() string

Binary returns the GPG binary location

func (*GPG) CreatePrivateKey added in v1.5.0

func (g *GPG) CreatePrivateKey(ctx context.Context) error

CreatePrivateKey will create a new GPG key in interactive mode

func (*GPG) CreatePrivateKeyBatch added in v1.5.0

func (g *GPG) CreatePrivateKeyBatch(ctx context.Context, name, email, passphrase string) error

CreatePrivateKeyBatch will create a new GPG keypair in batch mode

func (*GPG) Decrypt

func (g *GPG) Decrypt(ctx context.Context, path string) ([]byte, error)

Decrypt will try to decrypt the given file

func (*GPG) Encrypt

func (g *GPG) Encrypt(ctx context.Context, path string, content []byte, recipients []string) error

Encrypt will encrypt the given content for the recipients. If alwaysTrust is true the trust-model will be set to always as to avoid (annoying) "unusable public key" errors when encrypting.

func (*GPG) ExportPublicKey

func (g *GPG) ExportPublicKey(ctx context.Context, id, filename string) error

ExportPublicKey will export the named public key to the location given

func (*GPG) FindPrivateKeys

func (g *GPG) FindPrivateKeys(ctx context.Context, search ...string) (gpg.KeyList, error)

FindPrivateKeys searches for the given private keys

func (*GPG) FindPublicKeys

func (g *GPG) FindPublicKeys(ctx context.Context, search ...string) (gpg.KeyList, error)

FindPublicKeys searches for the given public keys

func (*GPG) GetRecipients

func (g *GPG) GetRecipients(ctx context.Context, file string) ([]string, error)

GetRecipients returns a list of recipient IDs for a given file

func (*GPG) ImportPublicKey

func (g *GPG) ImportPublicKey(ctx context.Context, filename string) error

ImportPublicKey will import a key from the given location

func (*GPG) ListPrivateKeys

func (g *GPG) ListPrivateKeys(ctx context.Context) (gpg.KeyList, error)

ListPrivateKeys returns a parsed list of GPG secret keys

func (*GPG) ListPublicKeys

func (g *GPG) ListPublicKeys(ctx context.Context) (gpg.KeyList, error)

ListPublicKeys returns a parsed list of GPG public keys

func (*GPG) Version

func (g *GPG) Version(ctx context.Context) semver.Version

Version will returns GPG version information

Jump to

Keyboard shortcuts

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