pinentry

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2021 License: MIT Imports: 9 Imported by: 4 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

pinentry

Pinentry client in Go

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))

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
⌂ 换网址