feat: decrypt ecdh works
This commit is contained in:
@@ -9,6 +9,7 @@ mod util;
|
||||
mod config;
|
||||
mod spec;
|
||||
mod crypto;
|
||||
mod wrap_key;
|
||||
mod file;
|
||||
mod card;
|
||||
mod cmd_info;
|
||||
@@ -38,6 +39,9 @@ enum Commands {
|
||||
/// PIN
|
||||
#[arg(long)]
|
||||
pin: Option<String>,
|
||||
/// SLOT
|
||||
#[arg(long)]
|
||||
slot: Option<String>,
|
||||
},
|
||||
/// Show file info
|
||||
#[command(arg_required_else_help = true, short_flag = 'I')]
|
||||
@@ -57,9 +61,9 @@ fn main() -> XResult<()> {
|
||||
paths.iter().for_each(|f| information!("{:?}", f));
|
||||
Ok(())
|
||||
}
|
||||
Commands::Decrypt { paths, pin } => {
|
||||
Commands::Decrypt { paths, pin, slot } => {
|
||||
for path in &paths {
|
||||
match cmd_decrypt::decrypt(path, &pin) {
|
||||
match cmd_decrypt::decrypt(path, &pin, &slot) {
|
||||
Ok(_) => success!("Decrypt {} succeed", path.to_str().unwrap_or("N/A")),
|
||||
Err(e) => failure!("Decrypt {} failed: {}", path.to_str().unwrap_or("N/A"), e),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user