opgpcard: tweak 'info' text output; add FIXME to re-work the form of algorithm information output

This commit is contained in:
Heiko Schaefer 2022-10-31 13:44:27 +01:00
parent ae25e6b608
commit 001bbd4412
No known key found for this signature in database
GPG key ID: 4A849A1904CCBD7D
2 changed files with 8 additions and 3 deletions

View file

@ -72,9 +72,14 @@ pub fn print_info(
} }
// Algorithm information (list of supported algorithms) // Algorithm information (list of supported algorithms)
//
// FIXME: this should be output in a more structured shape
// Algorithms should be grouped by key slot, and the format of the algorithm name should
// probably have a human readable, and an alternate machine readable format.
// Both formats should be output for machine readable formats.
if let Ok(Some(ai)) = card.algorithm_information() { if let Ok(Some(ai)) = card.algorithm_information() {
for line in ai.to_string().lines() { for line in ai.to_string().lines() {
let line = line.strip_prefix("- ").unwrap_or(line); let line = line.strip_prefix("- ").unwrap_or_else(|| line.trim());
output.algorithm(line.to_string()); output.algorithm(line.to_string());
} }
} }

View file

@ -142,9 +142,9 @@ impl Status {
} }
if self.verbose { if self.verbose {
if self.user_pin_valid_for_only_one_signature { if self.user_pin_valid_for_only_one_signature {
s.push_str(" User PIN presentation valid for one signature\n"); s.push_str(" User PIN presentation is valid for only one signature\n");
} else { } else {
s.push_str(" User PIN presentation valid for unlimited signatures\n"); s.push_str(" User PIN presentation is valid for unlimited signatures\n");
} }
} }
s.push_str(&format!(" Signatures made: {}\n", self.signature_count)); s.push_str(&format!(" Signatures made: {}\n", self.signature_count));