gpgagent

package module
v0.0.0-...-4ce3c65 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2022 License: Apache-2.0 Imports: 10 Imported by: 2

README

Provides a golang interface to the gnupg-agent daemon. It is currently oriented toward the "classic" version. Support for the modern version likely requires some changes to core openpgp go libraries to fundamentally incorporate communication with the new agent-centric key handling.

This package is a standalone fork of code in trousseau, which is in turn a fork from passphrase, which is a fork from camlistore.org.

Documentation

Overview

Package gpgagent interacts with the local GPG Agent.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoAgent = errors.New("GPG_AGENT_INFO not set in environment")
	ErrNoData  = errors.New("GPG_ERR_NO_DATA cache miss")
	ErrCancel  = errors.New("gpgagent: Cancel")
)

Functions

This section is empty.

Types

type Conn

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

Conn is a connection to the GPG agent.

func NewGpgAgentConn

func NewGpgAgentConn() (*Conn, error)

NewGpgAgentConn connects to the GPG Agent as described in the GPG_AGENT_INFO environment variable.

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) GetPassphrase

func (c *Conn) GetPassphrase(pr *PassphraseRequest) (passphrase string, outerr error)

func (*Conn) RemoveFromCache

func (c *Conn) RemoveFromCache(cacheKey string) error

type PassphraseRequest

type PassphraseRequest struct {
	CacheKey, Error, Prompt, Desc string

	// If the option --no-ask is used and the passphrase is not in
	// the cache the user will not be asked to enter a passphrase
	// but the error code GPG_ERR_NO_DATA is returned.  (ErrNoData)
	NoAsk bool
}

PassphraseRequest is a request to get a passphrase from the GPG Agent.

Directories

Path Synopsis
Example program that will attempt to decrypt the first argument with gpg, acquiring the passphrase through gpg-agent.
Example program that will attempt to decrypt the first argument with gpg, acquiring the passphrase through gpg-agent.

Jump to

Keyboard shortcuts

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