feat: updates
This commit is contained in:
@@ -6,8 +6,7 @@ use openssl::encrypt::Encrypter;
|
||||
use openssl::pkey::PKey;
|
||||
use openssl::rsa::Rsa;
|
||||
use rust_util::util_clap::{Command, CommandError};
|
||||
use rust_util::util_msg;
|
||||
|
||||
use crate::cmdutil;
|
||||
use crate::digest::sha256_bytes;
|
||||
|
||||
pub struct CommandImpl;
|
||||
@@ -23,12 +22,11 @@ impl Command for CommandImpl {
|
||||
.arg(Arg::with_name("data-hex").long("data-hex").takes_value(true).help("Data in HEX"))
|
||||
.arg(Arg::with_name("padding").long("padding").takes_value(true)
|
||||
.possible_values(&["pkcs1", "oaep", "pss", "none"]).help("Padding"))
|
||||
.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 pub_key_in = opt_value_result!(sub_arg_matches.value_of("pub-key-in"), "Require public key in");
|
||||
let pub_key_bytes = opt_result!(fs::read(pub_key_in), "Read file: {}, failed: {}", pub_key_in);
|
||||
|
||||
Reference in New Issue
Block a user