From 6cbc940b4f59d9d9ddaef729fb8db7b6ec63e533 Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Wed, 18 Sep 2019 18:49:29 +0200 Subject: openpgp: Change TPK::primary to return the key and not the binding - The primary key is not a binding; it is a single component. Thus, returning a ComponentBinding is misleading. - Add methods to the TPK structure to return the direct signatures, certifications, self revocations, and other revocations. --- tool/src/commands/decrypt.rs | 4 ++-- tool/src/commands/inspect.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'tool/src') diff --git a/tool/src/commands/decrypt.rs b/tool/src/commands/decrypt.rs index bde80c2b..2b0bc0c2 100644 --- a/tool/src/commands/decrypt.rs +++ b/tool/src/commands/decrypt.rs @@ -58,9 +58,9 @@ impl<'a> Helper<'a> { None => format!("{}", tsk.fingerprint().to_keyid()), }; - if can_encrypt(tsk.primary().key(), tsk.primary_key_signature(None)) { + if can_encrypt(tsk.primary(), tsk.primary_key_signature(None)) { let id = tsk.fingerprint().to_keyid(); - keys.insert(id.clone(), tsk.primary().key().clone().into()); + keys.insert(id.clone(), tsk.primary().clone().into()); identities.insert(id.clone(), tsk.fingerprint()); hints.insert(id, hint.clone()); } diff --git a/tool/src/commands/inspect.rs b/tool/src/commands/inspect.rs index 6d594c51..77694b0e 100644 --- a/tool/src/commands/inspect.rs +++ b/tool/src/commands/inspect.rs @@ -131,8 +131,8 @@ fn inspect_tpk(output: &mut io::Write, tpk: &openpgp::TPK, writeln!(output)?; writeln!(output, " Fingerprint: {}", tpk.fingerprint())?; inspect_revocation(output, "", tpk.revoked(None))?; - inspect_key(output, "", tpk.primary().key(), tpk.primary_key_signature(None), - tpk.primary().certifications(), + inspect_key(output, "", tpk.primary(), tpk.primary_key_signature(None), + tpk.certifications(), print_keygrips, print_certifications)?; writeln!(output)?; -- cgit v1.2.3