prompt

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2017 License: ISC Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PassPrompt

func PassPrompt(reader *bufio.Reader, prefix string, confirm bool) ([]byte, error)

PassPrompt prompts the user for a passphrase with the given prefix. The function will ask the user to confirm the passphrase and will repeat the prompts until they enter a matching response.

func PrivatePass

func PrivatePass(reader *bufio.Reader) ([]byte, error)

PrivatePass prompts the user for a private passphrase. All prompts are repeated until the user enters a valid response.

func ProvidePrivPassphrase

func ProvidePrivPassphrase() ([]byte, error)

ProvidePrivPassphrase is used to prompt for the private passphrase which maybe required during upgrades.

func ProvideSeed

func ProvideSeed() ([]byte, error)

ProvideSeed is used to prompt for the wallet seed which maybe required during upgrades.

func PublicPass

func PublicPass(reader *bufio.Reader, privPass []byte,
	defaultPubPassphrase, configPubPass []byte) ([]byte, error)

PublicPass prompts the user whether they want to add an additional layer of encryption to the wallet. When the user answers yes and there is already a public passphrase provided via the passed config, it prompts them whether or not to use that configured passphrase. It will also detect when the same passphrase is used for the private and public passphrase and prompt the user if they are sure they want to use the same passphrase for both. Finally, all prompts are repeated until the user enters a valid response.

func Seed

func Seed(reader *bufio.Reader) ([]byte, error)

Seed prompts the user whether they want to use an existing wallet generation seed. When the user answers no, a seed will be generated and displayed to the user along with prompting them for confirmation. When the user answers yes, a the user is prompted for it. All prompts are repeated until the user enters a valid response. The bool returned indicates if the wallet was restored from a given seed or not.

func Setup

func Setup(r *bufio.Reader, insecurePubPass, configPubPass []byte) (privPass, pubPass, seed []byte, err error)

Setup prompts for, from a buffered reader, the private and/or public encryption passphrases to secure a wallet and a previously derived wallet seed to use, if any. privPass and pubPass will always be non-nil values (private encryption is required and choosing to not use public data encryption will still encrypt the data with an insecure default), and a randomly generated seed of the recommended length will be generated and returned after the user has confirmed the seed has been backed up to a secure location.

The configPubPass parameter is optional (nil should be used to represent the lack of a value). When non-nil, this value represents a public passphrase previously specified in a configuration file. The user will be given the option of using this passphrase if public data encryption is enabled, otherwise a user-specified passphrase will be prompted for.

Types

This section is empty.

Jump to

Keyboard shortcuts

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