|
|
|
@ -71,6 +71,7 @@ pub(super) async fn handle(mut rx: Receiver<Atom>) -> Result<config::Operation,
|
|
|
|
|
output_priv: stage.output.ok_or_else(|| error::ConstructError::ExpectedNotPresent("output"))?,
|
|
|
|
|
output_pub: stage.output_public,
|
|
|
|
|
password: stage.password,
|
|
|
|
|
format: stage.format,
|
|
|
|
|
description: Default::default(), /* TODO */
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
@ -79,6 +80,7 @@ pub(super) async fn handle(mut rx: Receiver<Atom>) -> Result<config::Operation,
|
|
|
|
|
input: stage.input.map(|inp| (inp, input_pw)),
|
|
|
|
|
output: stage.output.ok_or_else(|| error::ConstructError::ExpectedNotPresent("output"))?,
|
|
|
|
|
password: stage.password,
|
|
|
|
|
format: stage.format,
|
|
|
|
|
description: Default::default(), /* TODO */
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
@ -146,13 +148,13 @@ pub(super) async fn parse<I: IntoIterator<Item=String>>(args: I, mut atoms: mpsc
|
|
|
|
|
"PEM" => KeyFormat::PEM,
|
|
|
|
|
"BIN" => KeyFormat::Bin,
|
|
|
|
|
"TEXT" => KeyFormat::Text,
|
|
|
|
|
__ => return Err((arg, error::ParseErrorKind::UnknownKeyFormat("rsa")).into()),
|
|
|
|
|
other => return Err((arg, error::ParseErrorKind::UnknownKeyFormat("rsa", other.to_owned())).into()),
|
|
|
|
|
})).await?,
|
|
|
|
|
"format" =>
|
|
|
|
|
send!(GenerateAtom::Format(match take_one!("--format: Expected output format").to_uppercase().trim() {
|
|
|
|
|
"BIN" => KeyFormat::Bin,
|
|
|
|
|
"TEXT" => KeyFormat::Text,
|
|
|
|
|
__ => return Err((arg, error::ParseErrorKind::UnknownKeyFormat("aes")).into()),
|
|
|
|
|
other => return Err((arg, error::ParseErrorKind::UnknownKeyFormat("aes", other.to_owned())).into()),
|
|
|
|
|
})).await?,
|
|
|
|
|
_ => return Err((arg, error::ParseErrorKind::UnexpectedArg(None)).into()),
|
|
|
|
|
}
|
|
|
|
|