feat: v1.10.16

This commit is contained in:
2025-01-12 10:12:14 +08:00
parent d27f0d5f83
commit c48493f892
4 changed files with 9 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ use clap::{App, Arg, ArgMatches, SubCommand};
use der_parser::ber::BerObjectContent;
use pem::Pem;
use rust_util::util_clap::{Command, CommandError};
use rust_util::util_msg;
use yubikey::{Key, YubiKey};
use yubikey::piv::{AlgorithmId, sign_data};
@@ -25,6 +26,8 @@ impl Command for CommandImpl {
}
fn run(&self, _arg_matches: &ArgMatches, sub_arg_matches: &ArgMatches) -> CommandError {
util_msg::set_logger_std_out(false);
let namespace_opt = sub_arg_matches.value_of("namespace");
let namespace = match namespace_opt {
None => return simple_error!("Namespace required"),

View File

@@ -6,6 +6,7 @@ use base64::engine::general_purpose::STANDARD;
use base64::Engine;
use clap::{App, Arg, ArgMatches, SubCommand};
use rust_util::util_clap::{Command, CommandError};
use rust_util::util_msg;
use yubikey::piv::AlgorithmId;
use yubikey::{Key, YubiKey};
@@ -21,6 +22,8 @@ impl Command for CommandImpl {
}
fn run(&self, _arg_matches: &ArgMatches, sub_arg_matches: &ArgMatches) -> CommandError {
util_msg::set_logger_std_out(false);
let slot = opt_value_result!(sub_arg_matches.value_of("slot"), "--slot must assigned, e.g. 82, 83 ... 95, 9a, 9c, 9d, 9e");
let ca = sub_arg_matches.is_present("ca");
let mut yk = opt_result!(YubiKey::open(), "YubiKey not found: {}");
@@ -81,7 +84,7 @@ impl Command for CommandImpl {
let ssh_pub_key_sha256 = sha256_bytes(&ssh_pub_key);
information!("SSH key SHA256: {} (base64)", STANDARD.encode(&ssh_pub_key_sha256));
information!("SSH key SHA256: {} (hex)", hex::encode(&ssh_pub_key_sha256));
println!();
eprintln!();
println!(
"{}ecdsa-sha2-{} {} Yubikey-PIV-{}",