gopass: Index | Examples | Files

package pinentry

import ""

Package pinentry implements a cross platform pinentry client. It can be used to obtain credentials from the user through a simple UI application.



Package Files

pinentry.go pinentry_others.go


var (
    // Unescape enables unescaping of percent encoded values,
    // disabled by default for backward compatibility. See #1621
    Unescape bool

func GetBinary Uses

func GetBinary() string

GetBinary returns the binary name

type Client Uses

type Client struct {
    // contains filtered or unexported fields

Client is a pinentry client


pi, err := New()
if err != nil {
_ = pi.Set("title", "Agent Pinentry")
_ = pi.Set("desc", "Asking for a passphrase")
_ = pi.Set("prompt", "Please enter your passphrase:")
_ = pi.Set("ok", "OK")
pin, err := pi.GetPin()
if err != nil {

func New Uses

func New() (*Client, error)

New creates a new pinentry client

func (*Client) Close Uses

func (c *Client) Close()

Close closes the client

func (*Client) Confirm Uses

func (c *Client) Confirm() bool

Confirm sends the confirm message

func (*Client) GetPin Uses

func (c *Client) GetPin() ([]byte, error)

GetPin asks for the pin

func (*Client) Option Uses

func (c *Client) Option(value string) error

Option sets an option, e.g. "default-cancel=Abbruch" or "allow-external-password-cache"

func (*Client) Set Uses

func (c *Client) Set(key, value string) error

Set sets a key

Package pinentry imports 9 packages (graph) and is imported by 1 packages. Updated 2021-01-25. Refresh now. Tools for package owners.