gopass: github.com/justwatchcom/gopass/pkg/pinentry Index | Examples | Files

package pinentry

import "github.com/justwatchcom/gopass/pkg/pinentry"

Index

Examples

Package Files

pinentry.go pinentry_others.go

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

Code:

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

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

Set sets a key

Package pinentry imports 7 packages (graph). Updated 2018-06-22. Refresh now. Tools for package owners.