feat: add example - rsa_encrypt

This commit is contained in:
2022-04-03 18:52:42 +08:00
parent 83d25d6d97
commit fc28ed40e3
4 changed files with 59 additions and 33 deletions

View File

@@ -28,18 +28,18 @@ impl Command for CommandImpl {
let detail_output = sub_arg_matches.is_present("detail");
let mut yk = opt_result!(YubiKey::open(), "YubiKey not found: {}");
success!("Name: {}", yk.name());
success!("Version: {}", yk.version());
success!("Serial: {}", yk.serial());
information!("Version: {}", yk.version());
information!("Serial: {}", yk.serial());
match yk.chuid() {
Ok(chuid) => success!("CHUID: {}",chuid.to_string()),
Ok(chuid) => information!("CHUID: {}",chuid.to_string()),
Err(e) => warning!("CHUID: <none> {}", e),
}
match yk.cccid() {
Ok(cccid) => success!("CCCID: {}",cccid.to_string()),
Ok(cccid) => information!("CCCID: {}",cccid.to_string()),
Err(e) => warning!("CCCID: <none> {}", e),
}
match yk.get_pin_retries() {
Ok(pin_retries) => success!("PIN retries: {}",pin_retries),
Ok(pin_retries) => information!("PIN retries: {}",pin_retries),
Err(e) => warning!("PIN retries: <none> {}", e),
}
if sub_arg_matches.is_present("show-config") {