|
|
@ -191,12 +191,17 @@ async fn work(op: config::Operation) -> Result<(), eyre::Report>
|
|
|
|
match op {
|
|
|
|
match op {
|
|
|
|
config::Operation::Help => args::usage(),
|
|
|
|
config::Operation::Help => args::usage(),
|
|
|
|
config::Operation::GenerateKey(config::op::GenerateKey::Aes(aes)) => {
|
|
|
|
config::Operation::GenerateKey(config::op::GenerateKey::Aes(aes)) => {
|
|
|
|
|
|
|
|
// read input aes key if provided
|
|
|
|
let input_aes = match aes.input {
|
|
|
|
let input_aes = match aes.input {
|
|
|
|
Some((path, passwd)) => {
|
|
|
|
Some((path, passwd)) => {
|
|
|
|
|
|
|
|
Some(container::aes::read_aes_container(&path, (passwd, None)).await
|
|
|
|
|
|
|
|
.wrap_err(eyre!("Failed to read input AES container from file"))
|
|
|
|
|
|
|
|
.with_section(|| format!("{:?}", path).header("Path was"))?)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
_ => (),
|
|
|
|
_ => None,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
//TODO: Generate new key
|
|
|
|
|
|
|
|
//TODO: Save new key to file, in provided format, with password if needed
|
|
|
|
},
|
|
|
|
},
|
|
|
|
config::Operation::GenerateKey(config::op::GenerateKey::Rsa(rsa)) => {
|
|
|
|
config::Operation::GenerateKey(config::op::GenerateKey::Rsa(rsa)) => {
|
|
|
|
|
|
|
|
|
|
|
|