Documentation
¶
Overview ¶
Package passphrase provides passphrase input handling for encryption.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrPassphraseMismatch is returned when confirmation doesn't match. ErrPassphraseMismatch = errors.New("passphrases do not match") // ErrCancelled is returned when user cancels the operation. ErrCancelled = errors.New("operation cancelled") )
Functions ¶
This section is empty.
Types ¶
type Prompter ¶
type Prompter struct {
Stdin io.Reader
Stdout io.Writer
Stderr io.Writer
// contains filtered or unexported fields
}
Prompter handles passphrase input prompts.
func (*Prompter) PromptForDecrypt ¶
PromptForDecrypt prompts for passphrase for decryption (no confirmation).
func (*Prompter) PromptForEncrypt ¶
PromptForEncrypt prompts for passphrase with confirmation for encryption. Returns empty string if user chooses to continue without encryption after warning. Returns ErrCancelled if user declines to continue without encryption.
func (*Prompter) ReadFromStdin ¶
ReadFromStdin reads a single line from stdin without prompting. Used with --passphrase-stdin flag for non-interactive input.
func (*Prompter) WarnNonTTY ¶
func (p *Prompter) WarnNonTTY()
WarnNonTTY prints warning for non-TTY environment.
Click to show internal directories.
Click to hide internal directories.