feat: updates
This commit is contained in:
@@ -5,11 +5,11 @@ use std::io::{ErrorKind, Read};
|
||||
use clap::{App, Arg, ArgMatches, SubCommand};
|
||||
use digest::Digest;
|
||||
use openpgp_card::crypto_data::Hash;
|
||||
use rust_util::{util_msg, XResult};
|
||||
use rust_util::XResult;
|
||||
use rust_util::util_clap::{Command, CommandError};
|
||||
use sha2::{Sha256, Sha384, Sha512};
|
||||
|
||||
use crate::{pgpcardutil, pinutil};
|
||||
use crate::{cmdutil, pgpcardutil, pinutil};
|
||||
use crate::util::base64_encode;
|
||||
|
||||
const BUFF_SIZE: usize = 512 * 1024;
|
||||
@@ -49,12 +49,11 @@ impl Command for CommandImpl {
|
||||
.arg(Arg::with_name("use-sha384").long("use-sha384").help("Use SHA384 for file in"))
|
||||
.arg(Arg::with_name("use-sha512").long("use-sha512").help("Use SHA512 for file in"))
|
||||
.arg(Arg::with_name("algo").long("algo").takes_value(true).help("Algorithm, rsa, ecdsa, eddsa"))
|
||||
.arg(Arg::with_name("json").long("json").help("JSON output"))
|
||||
.arg(cmdutil::build_json_arg())
|
||||
}
|
||||
|
||||
fn run(&self, _arg_matches: &ArgMatches, sub_arg_matches: &ArgMatches) -> CommandError {
|
||||
let json_output = sub_arg_matches.is_present("json");
|
||||
if json_output { util_msg::set_logger_std_out(false); }
|
||||
let json_output = cmdutil::check_json_output(sub_arg_matches);
|
||||
|
||||
let pin_opt = sub_arg_matches.value_of("pass").or_else(|| sub_arg_matches.value_of("pin"));
|
||||
let pin_opt = pinutil::get_pin(pin_opt);
|
||||
|
||||
Reference in New Issue
Block a user