From 19a2d58bdb54a01a1865515d0def848312c366c5 Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Sat, 22 Apr 2023 12:31:17 +0800 Subject: [PATCH] feat: v1.5.4, list --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/cmd_list.rs | 21 ++++++++++++++++++++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 587c3e9..90321f2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -336,7 +336,7 @@ dependencies = [ [[package]] name = "card-cli" -version = "1.5.3" +version = "1.5.4" dependencies = [ "authenticator", "base64 0.13.1", diff --git a/Cargo.toml b/Cargo.toml index 0178845..311c328 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "card-cli" -version = "1.5.3" +version = "1.5.4" authors = ["Hatter Jiang "] edition = "2018" diff --git a/src/cmd_list.rs b/src/cmd_list.rs index cce32ef..3b2a4a6 100644 --- a/src/cmd_list.rs +++ b/src/cmd_list.rs @@ -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::>().join(", ") + ); } }