feat: updates
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
use crate::cmd_se_generate::print_se_key;
|
||||
use crate::keyutil::{parse_key_uri, KeyUri, KeyUsage};
|
||||
use crate::seutil;
|
||||
use crate::{cmdutil, seutil};
|
||||
use clap::{App, Arg, ArgMatches, SubCommand};
|
||||
use rust_util::util_clap::{Command, CommandError};
|
||||
use rust_util::util_msg;
|
||||
|
||||
pub struct CommandImpl;
|
||||
|
||||
@@ -22,20 +21,17 @@ impl Command for CommandImpl {
|
||||
.takes_value(true)
|
||||
.help("Key uri"),
|
||||
)
|
||||
.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 = cmdutil::check_json_output(sub_arg_matches);
|
||||
|
||||
if !seutil::is_support_se() {
|
||||
return simple_error!("Secure Enclave is NOT supported.");
|
||||
}
|
||||
let key_uri = sub_arg_matches.value_of("key").unwrap();
|
||||
|
||||
let json_output = sub_arg_matches.is_present("json");
|
||||
if json_output {
|
||||
util_msg::set_logger_std_out(false);
|
||||
}
|
||||
|
||||
let KeyUri::SecureEnclaveKey(se_key_uri) = parse_key_uri(key_uri)?;
|
||||
debugging!("Secure enclave key URI: {:?}", se_key_uri);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user