Documentation ¶
Index ¶
- Variables
- func CredentialName(key string) string
- func Serve(callbacks Callbacks, ver string) error
- type Callbacks
- type Client
- func (c *Client) Apply(s Settings) error
- func (c *Client) Close() error
- func (c *Client) Confirm() error
- func (c *Client) Current() Settings
- func (c *Client) GetPIN() (string, error)
- func (c *Client) Message() error
- func (c *Client) Reset() error
- func (c *Client) SetCancelBtn(text string) error
- func (c *Client) SetDesc(text string) error
- func (c *Client) SetError(text string) error
- func (c *Client) SetNotOkBtn(text string) error
- func (c *Client) SetOkBtn(text string) error
- func (c *Client) SetPasswdQualityCallback(callback func(string) int)
- func (c *Client) SetPrompt(text string) error
- func (c *Client) SetQualityBar(text string) error
- func (c *Client) SetRepeatError(text string) error
- func (c *Client) SetRepeatPrompt(text string) error
- func (c *Client) SetTimeout(timeout time.Duration) error
- func (c *Client) SetTitle(text string) error
- type Options
- type Settings
Constants ¶
This section is empty.
Variables ¶
var Info = server.ProtoInfo{ Greeting: "PinGO (w32)", Handlers: map[string]server.CommandHandler{ "SETDESC": setDesc, "SETPROMPT": setPrompt, "SETREPEAT": setRepeat, "SETREPEATERROR": setRepeatError, "SETERROR": setError, "SETOK": setOk, "SETNOTOK": setNotOk, "SETCANCEL": setCancel, "SETQUALITYBAR": setQualityBar, "SETQUALITYBAR_TT": setQualityBarToolTip, "SETGENPIN": setGenPINLabel, "SETGENPIN_TT": setGenPINToolTip, "SETTITLE": setTitle, "SETTIMEOUT": setTimeout, "CLEARPASSPHRASE": clearPassphrase, "GETINFO": getInfo, "SETKEYINFO": setKeyInfo, "RESET": resetState, }, Help: map[string][]string{}, GetDefaultState: func() interface{} { var s = DefaultSettings return &s }, SetOption: setOpt, }
Info is our pinentry protocol definition.
Functions ¶
func CredentialName ¶
CredentialName generates name of credential to be used as a key to store it in external cache.
Types ¶
type Callbacks ¶
type Callbacks struct { GetPIN func(*common.Pipe, *Settings) (string, *common.Error) Confirm func(*common.Pipe, *Settings) (bool, *common.Error) Msg func(*common.Pipe, *Settings) *common.Error }
Callbacks list functions to be implemented by caller.
type Client ¶
Client for Assuan Session.
func Launch ¶
Launch starts pinentry binary found in directories from PATH envvar and creates pinentry.Client for interaction with it.
func LaunchCustom ¶
LaunchCustom starts pinentry binary specified by passed path and creates pinentry.Client for interaction with it.
func New ¶
func New(stream io.ReadWriter) (Client, error)
New initializes Client but does not start pinentry binary.
func (*Client) Confirm ¶
Confirm shows window with Cancel and Ok buttons but without password textbox, error is returned if Cancel is pressed (as usual).
func (*Client) GetPIN ¶
GetPIN shows window with password textbox, Cancel and Ok buttons. Error is returned if Cancel is pressed.
func (*Client) SetCancelBtn ¶
SetCancelBtn sends SETCANCEL Assuan command and stores results.
func (*Client) SetNotOkBtn ¶
SetNotOkBtn sends SETNOTOK Assuan command and stores results.
func (*Client) SetPasswdQualityCallback ¶
SetPasswdQualityCallback stores quality check callback.
func (*Client) SetQualityBar ¶
SetQualityBar sends SETQUALITYBAR Assuan command and stores results.
func (*Client) SetRepeatError ¶
SetRepeatError sends SETREPEATERROR Assuan command and stores results.
func (*Client) SetRepeatPrompt ¶
SetRepeatPrompt sends SETREPEAT Assuan command and stores results.
func (*Client) SetTimeout ¶
SetTimeout sends SETTIMEOUT Assuan command and stores results.
type Options ¶
type Options struct { Grab bool AllowExtPasswdCache bool Display string TTYType string TTYName string TTYAlert string LCCtype string LCMessages string Owner string TouchFile string ParentWID string InvisibleChar string }
Options part of Setting structure.
type Settings ¶
type Settings struct { // Some commands now allow argument passing CmdArgs string // Detailed description of request. Desc string // Text right before textbox. Prompt string // Error to show. Reset after GetPin. Error string // Text on OK button. OkBtn string // Text on NOT OK button. // Broken in GnuPG's pinentry (2.2.5). NotOkBtn string // Text on CANCEL button. CancelBtn string // Window title. Title string // Prompt timeout. Any user interaction disables timeout. Timeout time.Duration // Text right before repeat textbox. // Repeat textbox is hidden after GetPin. RepeatPrompt string // Error text to be shown if passwords do not match. RepeatError string // Text before password quality bar. QualityBar, QualityBarToolTip string // label and tooltip to be used for a generate action. GenPINLabel, GenPINToolTip string // To identify a key for caching - empty string mean that the key does not have a stable identifier. KeyInfo string // Password quality callback. PasswordQuality func(string) int Opts Options // For getInfo Ver string }
Settings struct contains options for pinentry prompt.
var DefaultSettings Settings
DefaultSettings keep global initial state to avoid initialization loop.