feat: v1.12.2
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
use clap::{App, Arg, ArgMatches, SubCommand};
|
||||
use rust_util::util_clap::{Command, CommandError};
|
||||
use yubikey::{PinPolicy, piv, TouchPolicy, YubiKey};
|
||||
use yubikey::{PinPolicy, piv, TouchPolicy};
|
||||
use yubikey::piv::{AlgorithmId, SlotId};
|
||||
|
||||
use crate::{cmdutil, pinutil};
|
||||
use crate::{cmdutil, pinutil, yubikeyutil};
|
||||
|
||||
pub struct CommandImpl;
|
||||
|
||||
@@ -14,6 +14,7 @@ impl Command for CommandImpl {
|
||||
SubCommand::with_name(self.name()).about("PIV generate subcommand")
|
||||
.arg(cmdutil::build_pin_arg())
|
||||
.arg(Arg::with_name("force").long("force").help("Force generate"))
|
||||
.arg(cmdutil::build_serial_arg())
|
||||
// .arg(cmdutil::build_json_arg())
|
||||
}
|
||||
|
||||
@@ -28,7 +29,7 @@ impl Command for CommandImpl {
|
||||
failure_and_exit!("--force must be assigned");
|
||||
}
|
||||
|
||||
let mut yk = opt_result!(YubiKey::open(), "YubiKey not found: {}");
|
||||
let mut yk = yubikeyutil::open_yubikey_with_args(sub_arg_matches)?;
|
||||
opt_result!(yk.verify_pin(pin.as_bytes()), "YubiKey verify pin failed: {}");
|
||||
|
||||
let public_key_info = opt_result!(piv::generate(&mut yk,SlotId::Signature, AlgorithmId::Rsa2048,
|
||||
|
||||
Reference in New Issue
Block a user