pinentry

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

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

Index

Examples

Constants

This section is empty.

Variables

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

Functions

func GetBinary

func GetBinary() string

GetBinary returns the binary name

Types

type Client

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

Client is a pinentry client

Example
pi, err := New()
if err != nil {
	panic(err)
}
_ = 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 {
	panic(err)
}
fmt.Println(string(pin))
Output:

func New

func New() (*Client, error)

New creates a new pinentry client

func (*Client) Close

func (c *Client) Close()

Close closes the client

func (*Client) Confirm

func (c *Client) Confirm() bool

Confirm sends the confirm message

func (*Client) GetPin

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

GetPin asks for the pin

func (*Client) Option

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

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

func (*Client) Set

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

Set sets a key

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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