diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-02-05 15:14:23 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-02-05 17:07:07 +0100 |
commit | df8474a1ecbc880c468799d22de10616ef96e318 (patch) | |
tree | 5daadf0e4b3f72f547952d9691ee74e2e32c6c49 /tool/src/commands/inspect.rs | |
parent | ef80b2ef0f4d783ead18a89325c7b59b2d01d787 (diff) |
sq: Inspect user attributes, unknown components and bad sigs.
Diffstat (limited to 'tool/src/commands/inspect.rs')
-rw-r--r-- | tool/src/commands/inspect.rs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tool/src/commands/inspect.rs b/tool/src/commands/inspect.rs index 162e90aa..c83c8c95 100644 --- a/tool/src/commands/inspect.rs +++ b/tool/src/commands/inspect.rs @@ -166,6 +166,41 @@ fn inspect_cert(policy: &dyn Policy, writeln!(output)?; } + for uab in cert.user_attributes().bindings() { + writeln!(output, " UserID: {:?}", uab.user_attribute())?; + inspect_revocation(output, "", uab.revoked(policy, None))?; + if let Some(sig) = uab.binding_signature(policy, None) { + if let Err(e) = + sig.signature_alive(None, std::time::Duration::new(0, 0)) + { + writeln!(output, " Invalid: {}", e)?; + } + } + inspect_certifications(output, + uab.certifications(), + print_certifications)?; + writeln!(output)?; + } + + for ub in cert.unknowns() { + writeln!(output, " Unknown component: {:?}", ub.unknown())?; + if let Some(sig) = ub.binding_signature(policy, None) { + if let Err(e) = + sig.signature_alive(None, std::time::Duration::new(0, 0)) + { + writeln!(output, " Invalid: {}", e)?; + } + } + inspect_certifications(output, + ub.certifications(), + print_certifications)?; + writeln!(output)?; + } + + for bad in cert.bad_signatures() { + writeln!(output, " Bad Signature: {:?}", bad)?; + } + Ok(()) } |