parse: generate: added input-password

master
Avril 4 years ago
parent 608e83d65d
commit 4894cf985e
Signed by: flanchan
GPG Key ID: 284488987C31F630

23
Cargo.lock generated

@ -39,6 +39,17 @@ version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034"
[[package]]
name = "atty"
version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
dependencies = [
"hermit-abi",
"libc",
"winapi 0.3.9",
]
[[package]]
name = "autocfg"
version = "1.0.1"
@ -616,6 +627,7 @@ dependencies = [
"color-eyre",
"cryptohelpers",
"lazy_static",
"recolored",
"rustc_version",
"serde",
"smallmap",
@ -666,6 +678,17 @@ dependencies = [
"rand_core",
]
[[package]]
name = "recolored"
version = "1.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1584c92dd8a87686229f766bb3a62d263a90c47c81e45a49f1a6d684a1b7968d"
dependencies = [
"atty",
"lazy_static",
"winapi 0.3.9",
]
[[package]]
name = "redox_syscall"
version = "0.1.57"

@ -19,6 +19,7 @@ tracing-subscriber = "0.2.12"
tracing-futures = "0.2.4"
tracing-error = "0.1.2"
smallmap = "1.1.2"
recolored = "1.9.3"
[build-dependencies]
rustc_version = "0.2"

@ -21,8 +21,8 @@ pub fn usage() -> !
licensed with GPL v3 or later
Usage: {program} [OPTIONS...] [-e|-d|-a] [-] [<files...>]
Usage: {program} --generate RSA [--input <old key>] [--password[=<password>]] [--format BIN|TEXT|PEM] <output> [<public part output>]
Usage: {program} --generate AES [--input <old key>] [--password[=<password>]] [--format BIN|TEXT] <output>
Usage: {program} --generate RSA [--input <old key>] [--input-password[=<password>]] [--password[=<password>]] [--format BIN|TEXT|PEM] <output> [<public part output>]
Usage: {program} --generate AES [--input <old key>] [--input-password[=<password>]] [--password[=<password>]] [--format BIN|TEXT] <output>
Usage: {program} --stat <key files...>
Usage: {program} --help

@ -143,6 +143,8 @@ pub(super) async fn parse<I: IntoIterator<Item=String>>(args: I, mut atoms: mpsc
send!(GenerateAtom::Password(Password::Specific(value.to_owned()))).await?;
},
"password" => send!(GenerateAtom::Password(Password::Yes)).await?,
"input-password" if value.is_some() => send!(GenerateAtom::InputPassword(Password::Specific(value.unwrap().to_owned()))).await?,
"input-password" => send!(GenerateAtom::InputPassword(Password::Yes)).await?,
"format" if mode.is_rsa() =>
send!(GenerateAtom::Format(match take_one!("--format: Expected output format").to_uppercase().trim() {
"PEM" => KeyFormat::PEM,

Loading…
Cancel
Save