Function readpassphrase::readpassphrase[][src]

pub fn readpassphrase(
    prompt: &str,
    buf_len: usize,
    flags: FlagsOr
) -> Result<String, Error>
Expand description

Displays a prompt to, and reads in a passphrase from, /dev/tty

If this file is inaccessible and the RPP_REQUIRE_TTY flag is not set, readpassphrase displays the prompt on the standard error output and reads from the standard input. In this case it is generally not possible to turn off echo.

Example:

let _pass = readpassphrase("Password:", 1024, Flags::RequireTty.into()).unwrap();
/* or */
let _pass = readpassphrase("Password:", 1024, Flags::RequireTty | Flags::ForceLower).unwrap();