summaryrefslogtreecommitdiffstats
path: root/tool
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2020-01-21 14:48:56 +0100
committerNeal H. Walfield <neal@pep.foundation>2020-01-21 14:51:55 +0100
commit11f851f76a90e24935306616a442c23f4161b3d3 (patch)
tree5ccafae8743bde30f2faf088ff20f4c75de0447d /tool
parent070735889b20199ee4d645d2897a551fe0851886 (diff)
tool: When inspecting a key, also show keys that are not valid now.
- Right now, 'sq inspect' skips keys that are not valid. This does not display keys from the future, or keys with expired self-signatures.
Diffstat (limited to 'tool')
-rw-r--r--tool/src/commands/inspect.rs16
1 files changed, 11 insertions, 5 deletions
diff --git a/tool/src/commands/inspect.rs b/tool/src/commands/inspect.rs
index 3640aca9..53597277 100644
--- a/tool/src/commands/inspect.rs
+++ b/tool/src/commands/inspect.rs
@@ -138,12 +138,18 @@ fn inspect_cert(output: &mut dyn io::Write, cert: &openpgp::Cert,
print_keygrips, print_certifications)?;
writeln!(output)?;
- for ka in cert.keys().policy(None).skip(1) {
+ for ka in cert.keys().skip(1) {
writeln!(output, " Subkey: {}", ka.key().fingerprint())?;
- inspect_revocation(output, "", ka.revoked())?;
- inspect_key(output, "", ka.key(), Some(ka.binding_signature()),
- ka.binding().certifications(),
- print_keygrips, print_certifications)?;
+ match ka.policy(None) {
+ Ok(ka) => {
+ inspect_revocation(output, "", ka.revoked())?;
+ inspect_key(output, "", ka.key(), Some(ka.binding_signature()),
+ ka.binding().certifications(),
+ print_keygrips, print_certifications)?;
+ }
+ Err(err) =>
+ writeln!(output, " Not valid: {}", err)?,
+ }
writeln!(output)?;
}