diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-04-15 14:08:09 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-04-15 15:48:23 +0200 |
commit | f227657e17d1fdc5ff18e5cff224ebed3476416e (patch) | |
tree | e6e57d9d923d6371f7751e398b274323f48dc1fe /tool/src/commands | |
parent | 896c71864a67231c6587fed066fbb2fbbac3165f (diff) |
openpgp: Drop Cert::primary_userid.
- Fixes #484.
Diffstat (limited to 'tool/src/commands')
-rw-r--r-- | tool/src/commands/decrypt.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tool/src/commands/decrypt.rs b/tool/src/commands/decrypt.rs index b6d27aa2..52778cdb 100644 --- a/tool/src/commands/decrypt.rs +++ b/tool/src/commands/decrypt.rs @@ -46,7 +46,9 @@ impl<'a> Helper<'a> { let mut identities: HashMap<KeyID, Fingerprint> = HashMap::new(); let mut hints: HashMap<KeyID, String> = HashMap::new(); for tsk in secrets { - let hint = match tsk.primary_userid(policy, None).ok() { + let hint = match tsk.with_policy(policy, None) + .and_then(|valid_cert| valid_cert.primary_userid()).ok() + { Some(uid) => format!("{} ({})", uid.userid(), KeyID::from(tsk.fingerprint())), None => format!("{}", KeyID::from(tsk.fingerprint())), |