pinentry

package
v1.10.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2020 License: MIT Imports: 7 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

This section is empty.

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

Jump to

Keyboard shortcuts

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