gopass: Index | Files

package cli

import ""


Package Files

binary.go export.go generate.go gpg.go gpg_others.go import.go key.go keyring.go loader.go parse_colons.go umask_others.go utils.go utils_linux.go version.go


var (

    // Ext is the file extension used by this backend
    Ext = "gpg"
    // IDFile is the name of the recipients file used by this backend
    IDFile = ".gpg-id"

func Binary Uses

func Binary(ctx context.Context, bin string) (string, error)

Binary reutrns the GGP binary location

func GPGOpts Uses

func GPGOpts() []string

GPGOpts parses extra GPG options from the environment

type Config Uses

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

Config is the gpg wrapper config

type GPG Uses

type GPG struct {
    // contains filtered or unexported fields

GPG is a gpg wrapper

func New Uses

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

New creates a new GPG wrapper

func (*GPG) Binary Uses

func (g *GPG) Binary() string

Binary returns the GPG binary location

func (*GPG) CreatePrivateKey Uses

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

CreatePrivateKey will create a new GPG key in interactive mode

func (*GPG) CreatePrivateKeyBatch Uses

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 Uses

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

Decrypt will try to decrypt the given file

func (*GPG) EmailFromKey Uses

func (g *GPG) EmailFromKey(ctx context.Context, id string) string

EmailFromKey extracts the email from a key id

func (*GPG) Encrypt Uses

func (g *GPG) Encrypt(ctx context.Context, plaintext []byte, recipients []string) ([]byte, 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 Uses

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

ExportPublicKey will export the named public key to the location given

func (*GPG) Ext Uses

func (g *GPG) Ext() string

Ext returns gpg

func (*GPG) FindPrivateKeys Uses

func (g *GPG) FindPrivateKeys(ctx context.Context, search ...string) ([]string, error)

FindPrivateKeys searches for the given private keys

func (*GPG) FindPublicKeys Uses

func (g *GPG) FindPublicKeys(ctx context.Context, search ...string) ([]string, error)

FindPublicKeys searches for the given public keys

func (*GPG) Fingerprint Uses

func (g *GPG) Fingerprint(ctx context.Context, id string) string

Fingerprint returns the full-length native fingerprint

func (*GPG) FormatKey Uses

func (g *GPG) FormatKey(ctx context.Context, id string) string

FormatKey formats the details of a key id

func (*GPG) IDFile Uses

func (g *GPG) IDFile() string

IDFile returns .gpg-id

func (*GPG) ImportPublicKey Uses

func (g *GPG) ImportPublicKey(ctx context.Context, buf []byte) error

ImportPublicKey will import a key from the given location

func (*GPG) Initialized Uses

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

Initialized always returns nil

func (*GPG) ListPrivateKeyIDs Uses

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

ListPrivateKeyIDs returns a parsed list of GPG secret keys

func (*GPG) ListPublicKeyIDs Uses

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

ListPublicKeyIDs returns a parsed list of GPG public keys

func (*GPG) Name Uses

func (g *GPG) Name() string

Name returns gpg

func (*GPG) NameFromKey Uses

func (g *GPG) NameFromKey(ctx context.Context, id string) string

NameFromKey extracts the name from a key id

func (*GPG) ReadNamesFromKey Uses

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

ReadNamesFromKey unmarshals and returns the names associated with the given public key

func (*GPG) RecipientIDs Uses

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

RecipientIDs returns a list of recipient IDs for a given file

func (*GPG) Version Uses

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

Version will returns GPG version information

Package cli imports 21 packages (graph). Updated 2019-07-30. Refresh now. Tools for package owners.