From 0679f73dae69199422812704a0f722ce38e5cb62 Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Sun, 1 Oct 2023 14:58:05 +0800 Subject: [PATCH] feat: v1.7.2 --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/cmd_piv.rs | 16 +++++++++++++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 22589a8..8b4d9c5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -320,7 +320,7 @@ dependencies = [ [[package]] name = "card-cli" -version = "1.7.1" +version = "1.7.2" dependencies = [ "authenticator", "base64 0.21.2", diff --git a/Cargo.toml b/Cargo.toml index 3de9f8a..8d23c9c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "card-cli" -version = "1.7.1" +version = "1.7.2" authors = ["Hatter Jiang "] edition = "2018" diff --git a/src/cmd_piv.rs b/src/cmd_piv.rs index a3a4e41..28738e1 100644 --- a/src/cmd_piv.rs +++ b/src/cmd_piv.rs @@ -52,10 +52,20 @@ impl Command for CommandImpl { } match yk.piv_keys() { - Ok(keys) => { + Ok(mut keys) => { information!("Found {} PIV keys", keys.len()); - if detail_output { - keys.iter().for_each(|k| debugging!("Found key: {:?}", k)); + keys.sort_by_key(|a| u8::from(a.slot())); + for k in keys { + information!( + "Found PIV #{:x} @{}, subject: {}, signature: {}", + u8::from(k.slot()), + k.slot(), + k.certificate().subject(), + k.certificate().cert.signature_algorithm.oid + ); + if detail_output { + debugging!("Found key: {:?}", k); + } } } Err(e) => failure!("Get PIV keys failed: {}", e)