feat: v1.5.4, list

This commit is contained in:
2023-04-22 12:31:17 +08:00
parent 8177586645
commit 19a2d58bdb
3 changed files with 22 additions and 3 deletions

2
Cargo.lock generated
View File

@@ -336,7 +336,7 @@ dependencies = [
[[package]]
name = "card-cli"
version = "1.5.3"
version = "1.5.4"
dependencies = [
"authenticator",
"base64 0.13.1",

View File

@@ -1,6 +1,6 @@
[package]
name = "card-cli"
version = "1.5.3"
version = "1.5.4"
authors = ["Hatter Jiang <jht5945@gmail.com>"]
edition = "2018"

View File

@@ -37,7 +37,26 @@ impl Command for CommandImpl {
success!("Serial: {}", yk.serial().0);
// success!("{:?}", yk.config());
if let Ok(pin_retries) = yk.get_pin_retries() {
success!("Pin retries: {}", pin_retries);
success!("PIN retries: {}", pin_retries);
}
if let Ok(config) = yk.config() {
information!("Protected data available: {}", config.protected_data_available);
information!("PIN last changed: {:?}", config.pin_last_changed);
information!("PUK blocked: {}", config.puk_blocked);
information!("PUK noblock on upgrade: {}", config.puk_noblock_on_upgrade);
information!("PUK mgm type: {:?}", config.mgm_type);
}
if let Ok(chuid) = yk.chuid() {
information!("Chuid: {}", chuid)
}
if let Ok(ccuid) = yk.cccid() {
information!("Ccuid: {}", ccuid)
}
if let Ok(piv_keys) = yk.piv_keys() {
information!("PIV keys: {}, slots: [{}]",
piv_keys.len(),
piv_keys.iter().map(|k| format!("{}", k.slot())).collect::<Vec<_>>().join(", ")
);
}
}